Tag Info

Hot answers tagged

32

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 ...


19

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 ...


10

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


9

file-max is the maximum File Descriptors (FD) enforced on a kernel level, which cannot be surpassed by all users without increasing. The ulimit is enforced on a user level, which can be less than the file-max. 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 ...


9

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 ...


8

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.


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

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

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 :)


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

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 ...


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

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 ...


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

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 ...


4

I was able to get the script to error out with the -v option: #!/bin/bash ulimit -v 100000 for i in {1..10000000} do x="x"$x done The Bash man page says: -m The maximum resident set size (many systems do not honor this limit)


4

sudo echo "limit maxfiles 1024 unlimited" >> /etc/launchd.conf does not work because sudo is in the wrong place, try this: echo 'limit maxfiles 10000 unlimited' | sudo tee -a /etc/launchd.conf


4

If the file descriptors are tcp sockets, etc, then you risk using up a large amount of memory for the socket buffers and other kernel objects; this memory is not going to be swappable. But otherwise, no, in principle there should be no problem. Consult the kernel documentation to try to work out how much kernel memory it will use, and/or test it. We run ...


4

Get the PID of the process that solr is running and then cat /proc/$SOLR_PID/limits -- this will tell you the actual limits of the process. I'd recommend to run things like solr as a seperated unprivileged user. When doing this you have multiple options (limits.conf or add a ulimit -n 2048 to the init script, ...). The last one isn't all that shiny but ...


4

echo "* hard nofile 102400" >> /etc/security/limits.conf echo "* soft nofile 102400" >> /etc/security/limits.conf sysctl -w fs.file-max=102400 sysctl -p The 4 steps can change your system's limits immediately, and can still work after your reboot. You can change the number "102400" to the number of max open-file in your linux system as ...


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

You should connect to the rsh daemon with strace and look for setrlimit calls: strace -p $PID -f -e trace=setrlimit They should differ in both versions. This should lead you to the problem.


4

The details of implementation vary across *nix platforms , but ulimit is initially set per user, with a default for all users that covers those who lack a specific setting. In the specific case of AIX, these settings are in /etc/security/limits. Linux uses the slightly-different name /etc/security/limits.conf to do the same job. To be safe, do man ...


4

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/


4

Modify /etc/security/limits.conf with what you need. Example: user soft nproc 64000 This line will set the number of processors (-u) to 64000 for "user". Soft/hard limits can be the same (soft allows spikes while hard prevents spawning).


3

You could always just cat /proc/sys/fs/file-nr During the 'high load' situation to see how many file descriptors are in use. As to a maximum - it just depends on what you are doing.



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