Limiting the usage of a resource (memory, disk space, CPU time, open files, network bandwidth, …) by a process or a group of processes.
4
votes
2answers
179 views
What is “automatic stack expansion”?
getrlimit(2) has the following definition
in the man pages:
RLIMIT_AS
The maximum size of the process's virtual memory (address space) in bytes. This limit affects calls to brk(2), mmap(2) and ...
0
votes
5answers
67 views
SSH login attempts per minute per IP
How can i limit SSH login attempts per minute per IP ?
I want to disable login attempts during 5 seconds after a failure. Is this possible ?
I'm not talking about ban a user after parsing logs like ...
2
votes
2answers
46 views
Externaly limiting number of CPU cores used
I need to externally limit a process/session to a certain number of cores.
Are there any other possibilities than CPU affinity (I don't like the need to specify the actual cores) and cgroups (hard to ...
19
votes
3answers
1k views
Can the “du” program be made less aggressive?
We have a regular job that does du summaries of a number of subdirectories, picking out worst offenders, and use the output to find if there are things that are rapidly rising to spot potential ...
3
votes
1answer
91 views
Modify ulimit (open files) of a specific process
Is it possible to change the soft - and hard limit of a specific process?
In my case, my process is mongod and a lot of web resources tell me to simply execute:
ulimit -n <my new value>
My ...
11
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 ...
4
votes
1answer
306 views
How many users does Linux support being logged in at the same time via SSH?
I know Linux supports multiple users being logged in at the same time.
But what's the maximum number of users that can be logged into Linux at the same time?
I see there are there are 69 tty files ...
7
votes
6answers
1k 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.
0
votes
0answers
37 views
Problem limiting the resources of a process
I want to limit the memory and cpu a process can use, because it is overloading my PC.
I open a terminal, run ulimit -v 4192000, run the process, open another terminal and run cpulimit -p ...
1
vote
2answers
54 views
understanding how to run script securely as limited user
I'm a long time dev but linux newbie. I've been building this (http://tryperl.com) to learn linux. So, my question is just about some *nix stuff I don't fully grok.
One of the things I want to do is ...
5
votes
1answer
195 views
How to solve this memory issue gracefully?
I have a standard Linux (Debian testing) laptop, with a swap partition.
I do a lot of experiments with it. Some of them are really memory hungry and the way Linux behaves by default is an issue for ...
3
votes
3answers
312 views
Can't add large number of rules to iptables
I made a very simple bash script (echo at start, runs commands, echos at end) to add approx 7300 rules to iptables blocking much of China and Russia, however it gets through adding approximately 400 ...
2
votes
0answers
76 views
Can I limit the number of inotify watches available to a process or cgroup?
I am consistently running out of inotify resources, leading to errors along the lines of:
# tail -f /some/files
tail: inotify resources exhausted
tail: inotify cannot be used, reverting to polling
...
3
votes
1answer
141 views
Can I limit connections per second for certain UserAgents using UFW?
GoogleBot is hitting my server hard - and even though I have set the CrawlRate in Webmaster Tools it is still hiking up the load on my server and slowing down Apache for the rest of the normal web ...
1
vote
1answer
2k views
How to modify ulimit for open files on SUSE Linux Enterprise Server 10.4 permanently?
SERVER:/etc # ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 96069
...
1
vote
1answer
305 views
How to avoid 4 core limit for Ubuntu within VMWare?
I have Ubuntu installed as VM on my laptop. My laptop has quad core with HT technology making it 8 cores.
Within Ubuntu VM I can only use max of 4 cores.
What should I do so I can access all 8?
...
4
votes
1answer
410 views
Are limits.conf values applied on a per-process basis?
I'm tuning the nofile value in /etc/security/limits.conf for my oracle user and I have a question about its behavior: does nofile limit the total number of files the user can have open for all of its ...
2
votes
1answer
158 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 ...
0
votes
0answers
242 views
Permanently change per-process stack size
When I use ulimit -s to change the per-process stack size, it only lasts for that login; if I restart the setting is lost. How can I permanently change the maximum stack size on my system?
2
votes
2answers
928 views
How to limit ftp speed
I have multiple user on a server, they upload and download their file through FTP, sometimes some heavy transfer make high load on server, I am wondering is there any way to limit ftp speed to avoid ...
4
votes
2answers
2k views
How to Throttle per process I/O to a max limit?
I'm looking for a way to limit a processes disk io to a set speed limit. Ideally the program would work similar to this:
$ limitio --pid 32423 --write-limit 1M
Limiting process 32423 to 1 megabyte ...
2
votes
2answers
93 views
How to constrain the resources an application can use on a linux web server
This is the situation:
I have a PHP/MySQL web application that does some PDF processing and thumbnail creation. This is done by using some 3rd party command line software on the server. Both kinds of ...
5
votes
2answers
285 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 # ...
10
votes
2answers
512 views
Is there an upper limit to the number of zombie processes you can have?
I used to work with an HP-UX system and the old admin told me there is an upper limit on the number of zombie processes you can have on the system, I believe 1024.
Is this a hard fact ceiling? I ...
20
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 ...
5
votes
4answers
1k 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% ...
13
votes
3answers
452 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
1answer
780 views
Linux Ubuntu - inode limitation on a 500GB hard disk ? Can you explain please?
I am launching a social networking website on LAMP Stack on Linux Ubuntu, I know that people are going to upload lots of pictures. Let's say I have 5000 users and each user upload a minimum of 100 ...
2
votes
3answers
239 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 ...
6
votes
1answer
953 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 ...
14
votes
2answers
4k 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 ...
9
votes
2answers
5k 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 ...
5
votes
4answers
2k 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 ...
3
votes
2answers
2k 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 ...
7
votes
2answers
2k 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
206 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.
7
votes
2answers
7k 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 ...
8
votes
5answers
3k 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
4
votes
1answer
681 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 ...
3
votes
1answer
3k 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
700 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
2k 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
5answers
3k 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>
...

