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)

5
votes
4answers
3k 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% ...
15
votes
3answers
572 views

Limiting a specific shell's internet bandwidth usage

I want update my linux in one shell but by default wget or axel in updater use all the bandwidth. How can I limit the speed in this shell? I want other shells to have a fair share, and to limit ...
2
votes
3answers
494 views

How can I read lines at a fixed speed?

I need to read a large log file and send it over a local network using (netbsd) netcat between two VMs on the same host workstation. I know that netcat has an interval, but as far as I can tell, the ...
7
votes
1answer
2k views

Throttling web crawlers

My website is being DoS'ed by Google webspiders. Google is welcome to index my site, but sometimes it is querying a tagcloud on my site faster than my webserver can produce the results, making my ...
16
votes
3answers
8k 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 ...
10
votes
2answers
10k 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 ...
4
votes
2answers
3k 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 ...
8
votes
2answers
4k views

How to limit available virtual memory per process

Occasionally some processes on my GNU/Linux desktop (such as gv and gnash) use up the physical memory and cause thrashing. Since these processes aren't important, I want them to be automatically ...
5
votes
1answer
230 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.
13
votes
2answers
14k views

Limit process to one cpu core

How to limit process to one cpu core ? Something similar to ulimit or cpulimit would be nice. (Just to ensure: I do NOT want to limit percentage usage or time of execution. I want to force app (with ...
7
votes
4answers
4k views

How do I limit the number of files printed by ls?

Is there a way to limit the quantity of listed files on a ls command? I've seen: ls | head -4 but to get head to be executed I need to wait for ls to finish execution, and with directories with an ...
9
votes
5answers
6k 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
1k views

File descriptor limits are lost after a system reboot

I'm trying to increase the default file descriptor limits for processes on my system. Specifically I'm trying to get the limits to apply to the Condor daemon and its sub-processes when the machine ...
22
votes
3answers
1k 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 ...
3
votes
1answer
4k views

How do I increase the number of semaphore arrays in Linux?

In a Debian lenny server running postgresql, I noticed that a lack of semaphore arrays is preventing Apache from starting up. Looking at the limits, I see 128 arrays used out of 128 arrays maximum, ...
4
votes
1answer
781 views

Linux - why is kernel.shmall so low by default?

I run DB2 on Linux where I have to allocate the vast majority of memory on the machine to shared memory segments. This page is typical of the info that I've found about shmall/shmmax: ...
4
votes
2answers
4k views

Set default nice value for a given user (limits.conf)

Could someone tell me how to set the default value of nice (as displayed by top) of a user? I have found that /etc/security/limits.conf is the place but if I put either: username_of_a_guy - nice ...
12
votes
3answers
2k 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 ...
13
votes
6answers
4k 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> ...
8
votes
6answers
2k views

How do I set a limit on the number of files Linux can have open?

I plan to run a Java app using nohup ... &. The limit must apply to commands like this.