Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:config:increasing-os-file-descriptor-limit [2019/07/05 16:05]
qtwrk
litespeed_wiki:config:increasing-os-file-descriptor-limit [2019/07/19 14:10]
Jackson Zhang
Line 1: Line 1:
 ===== How Can I Increase the Operating System File Descriptor Limit? ===== ===== How Can I Increase the Operating System File Descriptor Limit? =====
 +
 +"Too many open files" errors happen when a process needs to open more files than it is allowed by the operating system. This number is controlled by the maximum number of file descriptors the process has. If you experience such issue, you should increase the operating system file descriptor limit.
 +
 File descriptors are an abstract method for your system to store information about open files and thus facilitate communication. Each open file is assigned a file descriptor on file descriptor tables for the whole system and a certain process. The system puts limits on how big these tables can get and, as requests require the opening of files and thus the generating of file descriptors,​ these limits can constrain how many concurrent requests the server can handle. In UNIX-like operating systems, there are system-level and process-level file descriptor limits. For obvious reasons, the system-level file descriptor limit can restrict how much your server can handle, but, because LiteSpeed Web Server only uses a small number of server processes to serve all clients, LSWS can also require a higher process-level file descriptor limit. Therefore, to use your server to its maximum potential, it is important to set both these limits to a high enough value. File descriptors are an abstract method for your system to store information about open files and thus facilitate communication. Each open file is assigned a file descriptor on file descriptor tables for the whole system and a certain process. The system puts limits on how big these tables can get and, as requests require the opening of files and thus the generating of file descriptors,​ these limits can constrain how many concurrent requests the server can handle. In UNIX-like operating systems, there are system-level and process-level file descriptor limits. For obvious reasons, the system-level file descriptor limit can restrict how much your server can handle, but, because LiteSpeed Web Server only uses a small number of server processes to serve all clients, LSWS can also require a higher process-level file descriptor limit. Therefore, to use your server to its maximum potential, it is important to set both these limits to a high enough value.
  
Line 6: Line 9:
 **Process-level file descriptor limits** **Process-level file descriptor limits**
  
-Use the command ''​ulimit -n''​ to check current process-level file descriptor limit. You can reset these limits by adding a number after the command ​(e.g. ''​ulimit -n 10000''​).+Use the command ''​ulimit -n''​ to check current process-level file descriptor limit. ​You may find: 
 +  ulimit -n 
 +  32768 
 + 
 +You can reset these limits by adding a number after the command, such as: 
 +  ​ulimit -n 3276800
  
 Note: In Linux, non-root users can also use ''​ulimit -n xxxx''​ to change the process-level limit (at least in Kernel 2.4.x), but you need to add the following lines in /​etc/​security/​limits.conf to give these users permission: Note: In Linux, non-root users can also use ''​ulimit -n xxxx''​ to change the process-level limit (at least in Kernel 2.4.x), but you need to add the following lines in /​etc/​security/​limits.conf to give these users permission:
  • Admin
  • Last modified: 2019/07/19 14:10
  • by Jackson Zhang