Execute the following command on Ubuntu Server, you can see the default open file limit of 1024.
$ Ulimit -n
Edit / etc / profile configuration file, add a line at the end:
ulimit -SHn 65535
Let the configuration to take effect:
$ Sudo source / etc / profile
sudo: source: command not found
We direct execution ulimit -SHn 65535 command what will happen?
$ Ulimit -SHn 65535
-bash: ulimit: open files: can not modify limit: Operation not permitted
$ Sudo ulimit -SHn 65535
sudo: ulimit: command not found
But can not find the command prompt, and how to solve this problem after the ordinary user to obtain root privileges?
$ Sudo -s
# Source / etc / profile
Execute ulimit again, we can see that limit the number of open files has been changed to the 65535.
# Ulimit -n