Limiting the usage of a resource (memory, disk space, CPU time, open files, network bandwidth, …) by a process or a group of processes.

learn more… | top users | synonyms (1)

22
votes
4answers
2k views

How to limit resource usage to save CPU+RAM for a certain process?

I have a dev server on which sshd sometimes stops working because the machine runs out of RAM. Yes we are running low on memory and upgrading is not a feasible choice right now. What I want to do is ...
14
votes
2answers
15k views

How to create a user with limited RAM usage?

So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap ...
16
votes
6answers
6k views

Is there a way to limit the amount of memory a particular process can use in Unix?

I need to test a process for memory management. I do not have the source, so I need to do all the testing from the OS side. I want to be able to say something like limitmemory 400k -p <pid> ...
13
votes
3answers
3k views

Can I limit a process to a certain amount of time / CPU cycles?

We have a script which runs on our web servers, triggered by customer action, which initiates a unix process to generate some cache files. Because this process acts upon files supplied by our ...
6
votes
1answer
4k views

How to circumvent “Too many open files” in debian

If I want to see all relevant log files of my apache2 server at once, I use tail -f /var/kunden/logs/*log /var/kunden/logs/*log /var/log/apache2/*log |grep -v robots|grep -v favicon But since those ...
20
votes
3answers
19k views

Why is number of open files limited in Linux?

Right now, I know that: Find open files limit per process: ulimit -n Count all opened files by all process: lsof | wc -l Get maximum open files count allowd: cat /proc/sys/fs/file-max My ...
7
votes
3answers
5k views

Limit max connections per IP address and new connections per second with iptables

We have an Ubuntu 12.04 server with httpd on port 80 and we want to limit: the maximum connections per IP address to httpd to 10 the maximum new connections per second to httpd to 150 How can we ...
7
votes
4answers
5k views

Preventing tar from using too much CPU and disk (old laptop crashes if 100%)

I want to backup 1 terabyte of data to an external disk. I am using this command: tar cf /media/MYDISK/backup.tar mydata PROBLEM: My poor laptop freezes and crashes whenever I use 100% CPU or 100% ...
7
votes
2answers
711 views

What is a canonical way to find the actual maximum argument list length?

Following ARG_MAX, maximum length of arguments for a new process it seems like ARG_MAX is wrongly (or at least ambiguously) defined on my Mac Mini 3,1 running Ubuntu 12.04: $ getconf ARG_MAX # ...
3
votes
1answer
416 views

Control Dropbox upload rate on the command line

I'm using Dropbox without the GUI in Linux. I would like to limit the upload rate, sometimes large files eats my internet bandwidth. Anyone knows how I do that?
10
votes
6answers
9k views

How to limit log file size using >>

How can I limit the size of a log file written with >> to 200MB? $ run_program >> myprogram.log
5
votes
1answer
236 views

Why is the following command killing a system?

Anyone understand the following code , running in bash ? :(){ :|:& };: It seems to be a "fork" bomb on Linux.
3
votes
1answer
647 views

How do you increase MAXSYMLINKS

In a python script, I am creating a bunch of symbolic links chained together. example: link1->link2->link3->.......->somefile.txt I was wondering how you can change the max number of symlinks to be ...
2
votes
2answers
181 views

set packet rate limit via iptables

I have a packet rate limit (max. 10 per seconds) which is set by my internet provider. This is a problem if I want to use the AceStream player, because if I exceed the limit I get disconnected. How ...
6
votes
2answers
457 views

How can I allow a user to prioritize a process to negative niceness?

I want a user to run a specific process on the system with a negative nice value. I can't simply fork the process to background as this specific program is a minecraft server and I rely on the command ...
5
votes
2answers
4k views

ulimit PICKLE: “Operation not permitted” and “Command not found”

I'm trying to increase the maximum number of open files for the current user > ulimit -n 1024 I attempt to increase and fail as follows > ulimit -n 4096 bash: ulimit: open files: cannot ...
1
vote
1answer
1k views

how to determine the max user process value?

Which value is correct?(or they are all correct, but which one will take effect?) $ cat /proc/sys/kernel/pid_max 32768 $ ulimit -a |grep processes max user processes (-u) 77301 $ cat ...