Tag Info

Hot answers tagged

38

These limits came from a time where multiple "normal" users (not apps) would share the server, and we needed ways to protect them from using too many resources. They are very low for high performance servers and we generally set them to a very high number. (24k or so) If you need higher numbers, you also need to change the sysctl file-max option (generally ...


20

Under Leopard the initial process is launchd. The default ulimits of each process are inherited from launchd. For reference the default (compiled in) limits are $ sudo launchctl limit cpu unlimited unlimited filesize unlimited unlimited data 6291456 unlimited stack 8388608 ...


16

These "default" limits are applied by: the Linux kernel at boot time (to the init process), inheritance, from the parent process' limits (at fork(2) time), PAM when the user session is opened (can replace kernel/inherited values), the process itself (can replace PAM & kernel/inherited values, see setrlimit(2)). Normal users' processes cannot rise ...


12

Add the following line to your nginx and restart the process: worker_rlimit_nofile 30000; This will allow the workers to take on more files. You can then verify with: su - nobody ulimit -Hn ulimit -Sn This should output the new hard/soft limits. Reference


12

On newer kernels (2.6.32+) you can change this at runtime with /proc//limits: cd /proc/7671/ [root@host 7671]# cat limits | grep nice Max nice priority 0 0 [root@host 7671]# echo -n "Max nice priority=5:6" > limits [root@host 7671]# cat limits | grep nice Max nice priority 5 6 ...


10

The hard limit is the ceiling for the soft limit. The soft limit is what is actually enforced for a session or process. This allows the administrator (or user) to set the hard limit to the maximum usage they wish to allow. Other users and processes can then use the soft limit to self-limit their resource usage to even lower levels if they so desire.


10

Check the file /etc/security/limits.d/90-nproc.conf as this is likely overriding your settings. I wrote about this exact same issue last year http://scott.cm/max-processes-1024-limits-conf/


9

On RHEL6 (CentOS6) "max user processes" is set to 1024 by default. You can change this value in file: /etc/security/limits.d/90-nproc.conf See https://bugzilla.redhat.com/show_bug.cgi?id=432903 if you'd like to complain about it :)


8

file-max is the maximum File Descriptors (FD) enforced on a kernel level, which cannot be surpassed by all processes without increasing. The ulimit is enforced on a process level, which can be less than the file-max. There is no performance impact risk by increasing file-max. Modern distributions have the maximum FD set pretty high, whereas in the past it ...


7

You may have to uncomment pam_limits.so from the different files under /etc/pam.d (cron, su, sudo, sshd, login) session required pam_limits.so


7

As documented here, the prlimit command, introduced with util-linux 2.21 allows you to read and change the limits of running processes. This is a followup to the writable /proc/<pid>/limits, which was not integrated in mainline kernel. This solution should work. If you don't have prlimit(1) yet, you can find the code to a minimalistic version in the ...


7

I figured out that the system doesn't seem to like the wildcard for the user in limits.conf. Changing that to: root soft nofile 100000 and root hard nofile 100000 worked fine.


7

You can just change it as root. For example: $ ulimit -n 4096 $ ulimit -n 8192 bash: ulimit: open files: cannot modify limit: Operation not permitted $ sudo bash # ulimit -n 4096 # ulimit -n 8192 # su - normaluser $ ulimit -n 8192


7

You are changing hard limit values and querying soft limit values. Everything is working fine. Use ulimit -H to view hard limits.


6

worker_rlimit_nofile will set the limit for file descriptors for the worker processes as oppose to the user running nginx. If other programs running under this user will not be able to gracefully handle running out of file descriptiors then you should set this limit slightly less then what is for the user. First, What is using your file descriptors? Each ...


6

Your operating system set limits on how many files can be opened by any running application on your host. You can extend the basic values usually 1024 easily by modifying 2 configuration files: # vi /etc/sysctl.conf fs.file-max = 32000 # vi /etc/security/limits.conf youruser soft nofile 10000 youruser hard nofile 30000 The hard ...


6

Is the looping program actually using CPU? -t is for CPU time, not wall clock time, so if your program is not actually using any CPU time it won't be killed.


6

windows system resource manager is the tool to set cpu limits per process, and adds process accounting interfaces. In older versions of windows this was what was on the second disk that no-one ever installed. In 2008 its a feature to be enabled. Its generally not as important on a windows system (from a resource control perspective) than a unix one as ...


5

The limitation of ulimit is per unique user. So user1, regardless of how many times logged in or processes running, would be limited to 1024. It's combined. I am not sure if I completely understand the meaning of that sentence (English is not my mother tongue) If that sentence means the ulimit configuration for file descriptors is not a per-process ...


5

On Solaris you can set this parameter to be a hard or soft limit system-wide OR you can do the same for a specific application so that it has the correct number of open file descriptors in its run-time space. To make it a system-wide change, edit /etc/system with following entries # Hard limit on file descriptors for single process set rlim_fd_max = 4096 ...


5

Users who violate a soft limit quota get an e-mail indicating that they have a few days' grace period before the penalties kick in. Users who cross the hard limit threshold get no such grace period. The penalty differs depending on the particular quota, but usually nearly every command will fail such that the user will want to come into compliance quickly. ...


5

Set worker_rlimit_nofile 65535; in nginx.conf within the main context.


5

In Linux resource limits can be set in various locations based on the type of requirement. /etc/security/limits.conf file. /etc/sysctl.conf file. ulimit command /etc/security/limits.conf is part of pam_limits and so the limits that are set in this file is read by pam_limits module during login sessions. The login session can be by ssh or through ...


5

ulimit is a bash builtin, so it applies only to the shell, and particularly any processes created by the current shell. Hence if you change it for any reason you will have to do so in a persistent way. You might want to checkout the /etc/security/limits.conf file for setting session limits on a per-user basis. (which appears to be the CentOS preferred ...


5

May be max user processes (-u) 1024 is too low. Remember that processes and threads are counting together. You can use ps -eLF | grep adtech | wc -l to show your current value.


5

I finally found the problem, it seems upstart doesn't use the parameters defined at /etc/security/limits.conf, so when I launch mysql through the service command (and so, under upstart), it overrides those defined limits and uses the default 1024. The solution is to modify the mysql.conf file that defines the upstart service, it is located at ...


5

Unless they've done something really wacky (if so, blame systemd) that's all set in /etc/security/limits.conf. * soft nofile 8192 * hard nofile 8192 Something like that.


4

Well, the mystery is solved. I found that when I did su - wls81 I got the 1024 limit, but when I just did su wls81 I got the new, higher limit. It turns out that wls81's .bash_profile invoked another script, which in turn invoked an environment-setting script from a completely different user on the system, which did a ulimit -n 1024. When I removed that ...


4

From the ulimit builtins man page The ulimit builtin provides control over the resources available to the shell and to processes started by it on systems that allow such control. Your lsof command lists all of the open files for all processes for all users on the system. You are not comparing like with like.


4

Ok I have solved my issue, and in doing so come to a better understanding of how the ulimits work, at least in Ubuntu. There were a number of issues and I think I have sorted them all out. First problem, and a silly one: nofiles should be nofile in /etc/security/limits.conf Another more significant oversight: While I had ensured pam_limits.so was included ...



Only top voted, non community-wiki answers of a minimum length are eligible