To overcome this issue, UNIXes may be configured to allow a scalability that goes over 150K clients. For a given user and its group (rights allocated for your server), the best approach consists in increasing only this user and group limits.
First, we start by checking the current limitations with the following command:
ulimit -aThe line
-n
describes the maximum number of opened file descriptor. Usually, this value is set to
1024.To increase this really low value for a user 'server' and its associated group, edit your file
/etc/security/limits.conf
with root privileges and add or modify the following values:server soft nofile 150000 server hard nofile 200000
Now, you must add a new security policy by adding the following line to your file
/etc/pam.d/common-session
, editing it with root privileges:session required pam_limits.soFor taking this new value into account, a reboot of your server is necessary. Use the
ulimit
command to check if your new value has been properly set.
Note on NodeJS
The current status of NodeJS limits the heap memory to 1.4 GB per processus. Therefore, vertical scalability is limited to 250 K connections depending on your server's consumptions. There is 2 methods to overcome this issue: