Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This is the output of ulimit -a

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 16382
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

This is a 64bit install, and I would like to increase the max-open files from 1024 to a more heady limit such as 5000. Will that be any problem? Will it cause instability?

Thanks.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

max-open is number of files one user can keep open in single session simultaneously.

Also, please note that all limit settings are set per login. They are not global, nor are they permanent; existing only for the duration of the session.

(from man limits.conf(5))

Safe value for maximum number of really depends on your usage. Point with default values is to prevent trivial (accidental) denial of services. There is also global limit for number of open files:

cat /proc/sys/fs/file-max

You can change that number by running for example

echo 100000 > /proc/sys/fs/file-max

(with user root, obviously). Even better is to also add line fs.file-max = 10000 to /etc/sysctl.conf to load same setting after reboot.


As of ulimit: it's safe to increase that number. However, number of open files should not exceed global file-max, because then opening new files is not possible anymore (and for example logging in requires opening files).

If there is multiple users, remember that if you change the default, everyone can open more files. For example 30 users * 5000 files = 150 000 open files (assuming that everyone opens maximum number of files, and uses only single session). If you have some really resource hungry (as in opens really many files) software used by multiple users, it might be a problem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.