Questions tagged [ulimit]
ulimit is a Unix-like command line utility that provides control over the resources available to the shell and to processes started by it.
182
questions
86
votes
5
answers
180k
views
Practical maximum open file descriptors (ulimit -n) for a high volume system
We recently began load testing our application and noticed that it ran out of file descriptors after about 24 hours.
We are running RHEL 5 on a Dell 1955:
CPU: 2 x Dual Core 2.66GHz 4MB 5150 / ...
61
votes
3
answers
124k
views
Soft limit vs Hard limit?
Can anyone explain in layman's terms what the difference between soft and hard limit is?
Should I set my soft and hard limit to be the same? Or should soft be significantly lower? Does the system ...
44
votes
9
answers
164k
views
where are the default ulimit values set? (linux, centos)
I have two CentOS 5 servers with nearly identical specs. When I login and do ulimit -u, on one machine I get unlimited, and on the other I get 77824.
When I run a cron like:
* * * * * ulimit -u &...
42
votes
2
answers
58k
views
How do ulimit -n and /proc/sys/fs/file-max differ?
I notice that on a new CentOS image that I just booted up off of EC2 that the ulimit default is 1024 open files, but /proc/sys/fs/file-max is set at 761,408 and I'm wondering how these two limits work ...
39
votes
5
answers
70k
views
Set max file limit on a running process
I have a long running process that is eventually going to hit the max open file limit. I know how to change that after it fails, but is there a way to change that for the running process, from the ...
28
votes
7
answers
33k
views
Where are the default ulimits specified on OS X (10.5)?
The default nofile limit for OS X user accounts seems to be about 256 file descriptors these days. I'm trying to test some software that needs a lot more connections than that open at once.
On a ...
25
votes
3
answers
102k
views
How to set ulimit value permanently?
On Debian Wheezy, ulimit -a gives:
open files (-n) 1024
I add this to /etc/security/limits.conf
* hard nofile 64000
then reboot.
And ulimit -a ...
24
votes
5
answers
63k
views
ulimit -n not changing - values limits.conf has no effect
I am trying to raise the open file descriptor maximum for all users on an ubuntu machine.
This question is somewhat of a follow up to this question.
open file descriptor limits.conf setting isn'...
23
votes
3
answers
57k
views
Too many open files with nginx, can't seem to raise limit
The server is Ubuntu 13.04 (GNU/Linux 3.9.3-x86_64-linode33 x86_64).
nginx is nginx/1.2.6.
I've been working on this for an several hours now, so here's what I'm getting and here's what I've done.
...
19
votes
2
answers
88k
views
Increasing ulimit on CentOS
We have a CentOS box that I'm trying to increase the max number of files that a user can have open. Currently when I run ulimit -Sn I get 1024 and ulimit -Hn gives 4096. I need that number up around ...
19
votes
2
answers
76k
views
/etc/security/limits.conf soft nproc limit appears to be ignored
My MongoDB database was running into problems under load, with the following errors spamming the logs:
[initandlisten] pthread_create failed: errno:11 Resource temporarily unavailable
[initandlisten] ...
18
votes
2
answers
54k
views
nginx uLimit 'worker_connections exceed open file resource limit: 1024'
I keep getting this error in nginx/error.log and its driving me nuts:
8096 worker_connections exceed open file resource limit: 1024
I've tried everything I can think of and cant figure out what is ...
18
votes
1
answer
14k
views
Ubuntu 16.04 Server MySql open_file_limit won't go higher than 65536
I'm running Ubuntu 16.04 Server on XenServer and I'm running into an issue with MySql's open file limit.
Here's what I've done so far:
sudo nano /etc/security/limits.conf (reference)
* soft nofile ...
18
votes
2
answers
17k
views
open file descriptor limits.conf setting isn't read by ulimit even when pam_limits.so is required
I am trying to raise the open file descriptor maximum for all users on an ubuntu machine.
I've added the following lines to /etc/security/limits.conf:
* soft nofile 100000
...
18
votes
1
answer
11k
views
What's the difference between `lsof -p <pid> | wc -l` and `ls /proc/<pid>/fd | wc -l`?
Background: I'm playing around with monitoring the ulimit for running processes for a particular user. (I had occasionally seen processes that were getting started with an incorrect limit.) I asked a ...
18
votes
9
answers
45k
views
How to set ulimits for a service starting at boot?
I need, for mysql to use large-pages, to set a ulimit - I've done this in limits.conf. However, limits.conf (pam_limits.so), doesn't get read in for init, only for "real" shells. I solved this before ...
17
votes
4
answers
20k
views
How can lsof report a higher number of open files than what ulimit says should be allowed?
How can lsof report more open files than what ulimit says is the limit?
prod_web3(i-ca0b05aa):~$ sudo lsof | wc -l
4399
prod_web3(i-ca0b05aa):~$ ulimit -n
1024
16
votes
3
answers
81k
views
How can I permanently set ulimit -n 8192 in Centos 7?
I would like to permanently set the open file limit for all users in Centos 7, but there seems to be a lot of conflicting information out there on the googles.
16
votes
3
answers
26k
views
Ulimit file descriptor limits not being applied for particular process
I recently checked one of our redis processes to what ulimits where applied using:
cat /proc/<redis-pid>/limits
And was suprised to learn that is was at the low default value:
Limit ...
15
votes
4
answers
66k
views
Cannot switch, ssh to specific user: su: cannot set user id: Resource temporarily unavailable?
/var/log/secure:
su: pam_keyinit(su-l:session): Unable to change UID to 500 temporarily
su: pam_keyinit(su-l:session): Unable to change UID to 500 temporarily
su: pam_unix(su-l:session): session ...
15
votes
4
answers
31k
views
ulimit for windows
Are there true ulimit for windows?
I'm finding ways/programs how to prevent one program eating 100% cpu.
Thanks.
13
votes
2
answers
35k
views
What is the impact of increasing "nofile" limits in /etc/security/limits.conf?
I've found a number of articles describing how to increase the limits for the number of open files through /etc/security/limits.conf, but I don't understand the impact of doing so. Many times I see ...
13
votes
2
answers
23k
views
understanding max file descriptors for linux and nginx, and best value for worker_rlimit_nofile
I got the seemingly-common "too many file descriptors" error on nginx. After much searching, the solution is clearly to increase the number of file descriptors available to nginx. But there isn't ...
12
votes
1
answer
2k
views
Difference between ulimit, launchctl, sysctl?
When managing the limits of the operating system (specifically OSX), what is the difference and overlap between the functionality and history of these three tools:
ulimit
launchctl, launchd
sysctl
I ...
11
votes
6
answers
21k
views
Increase file ulimit for the asterisk daemon
How do i increase the file limit for the asterisk daemon on my ubuntu computer? When I login as root and use the ulimit, it says unlimited already. I can't login as asterisk because that user doesn'...
10
votes
5
answers
30k
views
How to set ulimits for mongod?
How do I set ulimits for the mongod process/user on CentOS?
I've read the official documentation but it doesn't provide OS-specific instructions.
I need to set ulimit -u 64000 and need this to ...
10
votes
2
answers
34k
views
How do ulimit settings impact Linux?
Lately, I had a EAGAIN error with some async code that made me take a closer look at ulimit settings. While I clearly understand certain limits, such as nofile, others are still quite confused to me.
...
9
votes
2
answers
6k
views
What are the ramifications of increasing the maximum # of open file descriptors
Ubuntu seems to have a default limit of 1024 open file descriptors. Nginx was complaining during some load testing I was doing that the maximum number has been reached and the server basically was ...
9
votes
4
answers
28k
views
Why does redis report limit of 1024 files even after update to limits.conf?
I see this error at the top of my redis.log file:
Current maximum open files is 1024. maxclients has been reduced to
4064 to compensate for low ulimit.
I have followed these steps to the letter (...
9
votes
1
answer
14k
views
Changing open-files-limit in mysql 5.5
I'm having an issue with mysql 5.5 running on Ubuntu 12.04 with the open-files-limit parameter.
I recently noticed some problems due to the 1024 limit, and actually the main system limit was set to ...
9
votes
3
answers
7k
views
proc's limit and ulimit -f don't match
I have an issue where a process has a different max file size than the ulimit for a user. The log file for this process is basically not growing past 524288
proc:
less /proc/20238/limits
Limit ...
8
votes
3
answers
18k
views
determine ulimit for root user
we believe we have increased the max open file descriptors for the root user. This was done by adding this line to /etc/security/limits.conf:
* - nofile 2048
We think we've ...
8
votes
3
answers
17k
views
samba stuck at maximum of 1024 open files
I'm running a Ubuntu 10.04 (lucid) samba fileserver. I have a Windows 7 client which opens a large number of files while doing a copy of thousands of tiny files at once. It receives the error "Too ...
8
votes
2
answers
36k
views
How to configure linux file descriptor limit with fs.file-max and ulimit
Server applications running on linux often require large quantities of open file handlers, for ex. HBase ulimit, Hadoop epoll limit
This wiki entry should serve as documentary for Linux file limits ...
8
votes
1
answer
4k
views
limits.conf setting doesn't 'stick'
Trying to get the equivalent of ulimit -n 20000 on a high load web server, however the /etc/security/limits.conf on ubuntu hardy doesn't seem to stick.
here is what I set in the config file.
root ...
7
votes
5
answers
82k
views
How to set ulimits in Solaris 10
I normally use pam_limits.so and /etc/security/limits.conf to set ulimits on file size, CPU time, etc. for the regular users logging in to my server running Ubuntu. What is the best way of doing ...
7
votes
2
answers
16k
views
It should be set to 65000 to avoid operational disruption
I'm following Taking Solr to Production | Apache Solr Reference Guide 8.5, however unable to overcome warning while restarting solr service:
# service solr restart
*** [WARN] *** Your open file limit ...
7
votes
1
answer
27k
views
centos/redhat: change open files ulimit without reboot?
The hard limit of the number of open files is set to 1024 on my machine.
I changed /etc/security/limits.conf and added 'idror hard nofile 65000'.
In my shell I tried ulimit -n 65000. I get 'ulimit: ...
7
votes
5
answers
18k
views
limits.conf not being applied.
I have the following lines in /etc/security/limits.conf
* soft nofile 32768
* hard nofile 65536
root soft nofile 32768
root ...
7
votes
1
answer
4k
views
Are ulimits inherited by the shell, by the user, or a combination?
When a process spawns a subshell, how is the ulimit inherited?
Is it by user, by shell, or a combination?
Specifically, this was found in the context of HP Server Automation jobs failing on some ...
6
votes
2
answers
24k
views
Getting Too many Open files error for Postgres
In Ubuntu 14.04 server on a JAVA application we are getting Too many Open files error for Postgres (Using Postgresql 9.5).
We set the following in /etc/security/limits.conf
* soft nofile 16384
* ...
6
votes
2
answers
16k
views
Understanding ulimit -u
I'd like to understand what's going on here.
linvx$ ( ulimit -u 123; /bin/echo nst )
nst
linvx$ ( ulimit -u 122; /bin/echo nst )
-bash: fork: Resource temporarily unavailable
Terminated
linvx$ ( ...
6
votes
3
answers
17k
views
can't log in when nofile is set to unlimited in /etc/security/limits.conf
I set the following values (-1 will be resolved to unlimited, I suppose) in /etc/security/limits.conf (CentOS 6.2)
root nofile soft -1
root nofile hard -1
and I can't log in with root user now. ...
6
votes
1
answer
17k
views
How to set systemwide ulimit on ubuntu
I want to set systemwide ulimit on ubuntu (all processes, all users).
How can I set it?
thanks
JP
6
votes
2
answers
8k
views
"open files" ulimit: controlling via limits.conf
I'm banging my head on this, and I can't understand why it's not working. I'm hoping that someone can shed light on this, or failing that, give me some suggestions for avenues of investigation.
I've ...
6
votes
3
answers
10k
views
Squid running out of file descriptors on Ubuntu
I am running Squid 2.7 on Ubuntu 10.04 64bits.
I had the problem of Squid running out of file descriptors, with the following error showing in /var/log/squid/cache.log:
WARNING! Your cache is ...
6
votes
2
answers
2k
views
How to change stack depth limits in /etc/security/limits.d/ and have the changes apply to services at boot
My system
Series of Ubuntu 14.04.5 (x86_64) Servers, kept updated
My application required I increase stack depth for postgres
I created a file in /etc/security/limits.d/myapplication.conf
The ...
5
votes
4
answers
10k
views
How to increase max FD limit for a daemon process running under a headless user?
To increase the FD limit for a daemon process running under a headless user on a Ubuntu Linux machine we did following changes in /etc/security/limits.conf
soft nofile 10000
hard nofile 10000
We ...
5
votes
2
answers
5k
views
Using ulimit to limit the amount of memory a script can use
I have an ubuntu system and I have a script that runs regularly. I need to limit the maximum amount of memory that this script can use. AFAIK ulimit is the command to do this, however I can't get it ...
5
votes
1
answer
7k
views
Is this the correct way to permanently set the ulimit in Debian?
Manually I can set via ulimit -n 20000 the file descriptor limit and it works fine. To have this limit for every user also after a restart of the machine, can I add
* soft nofile ...