Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
litespeed_wiki:cloudlinux:cl_lve_vs_lsws_php_suexec_max_conn [2016/03/23 13:42] Jackson Zhang |
litespeed_wiki:cloudlinux:cl_lve_vs_lsws_php_suexec_max_conn [2017/08/28 17:57] Johathan Kagan |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== LSWS “PHP suEXEC Max Conn” should be always less than CloudLinux LVE EP limit ====== | + | ====== LiteSpeed Web Server's PHP suEXEC Max Conn setting should always be set to a value less than the CloudLinux LVE EP limit ====== |
LVE is a kernel level technology developed by the CloudLinux team. | LVE is a kernel level technology developed by the CloudLinux team. | ||
- | Each LVE limits amount of entry processes (web server processes entering into LVE) to prevent single site exhausting all web server processes. If the limit is reached, then mod_hostinglimits will not be able to place web server process into LVE, and will return error code 508. This way very heavy site would slow down and start returning 508 errors, without affecting other users. | + | Each LVE limits the amount of entry processes (web server processes entering into the LVE) to prevent a single site exhausting all web server processes. If the limit is reached, then mod_hostinglimits will not be able to place web server processes into the LVE and will return a 508 error. This results in very heavy sites slowing down and returning 508 errors without impacting other users. |
If the site is limited by CPU or IO, then the site will start responding slower. | If the site is limited by CPU or IO, then the site will start responding slower. | ||
- | If the site is limited by memory or number of processes limits, then the user will recieve 500 or 503 errors that server cannot execute the script. | + | If the site has limits set on memory or its number of processes, then the user will receive 500 or 503 errors that the server cannot execute the script. |
- | What's the LSWS "PHP suEXEC Max Conn"? Any relationship between "PHP suEXEC Max Conn" and CloudLinux LVE? | + | [[https://www.litespeedtech.com/docs/webserver/config/general#phpSuExecMaxConn|PHP suEXEC Max Conn]] is a LiteSpeed Web Server setting which specifies the maximum number of concurrent PHP processes that can be created by LSWS for each user when running PHP scripts in suEXEC mode. The default value for this setting is 5. This limit is per user per lshttpd process. Thus, if you have a 2-CPU license, this limit will be doubled. The limit will be 4x for a 4-CPU license, and so on. |
- | [[https://www.litespeedtech.com/docs/webserver/config/general#phpSuExecMaxConn|"PHP suEXEC Max Conn"]] is a LiteSpeed web server setting, which specifies the maximum number of concurrent PHP processes that can be created by LSWS for each user when running PHP scripts in suEXEC mode. Default value is 5. This limit is per user per lshttpd process. Thus, if you have a 2-CPU license, this limit will be doubled. The limit will be 4x for a 4-CPU license, and so on. | + | Limits on entry processes(EP) control the number of entries into an LVE. NPROC controls the total number of processes within an LVE. Once the limit is reached, no new processes can be created (until another one dies). When that happens, the NPROC counter is incremented. In these cases, LSWS might return 500 or 503 errors. |
- | Entry processes(EP) limit control the number of entries into LVE. NPROC controls the total number of processes within LVE. Once the limit is reached, no new process can be created (until another one dies). When that happens NPROC counter is incremented. Web server might return 500 or 503 errors in such case. | + | For shared hosting environments, ''PHP suEXEC Max Conn'' should not be set too high. Generally 5 or 10 is acceptable. Under normal circumstances, this value should not exceed 50. If the ''PHP suEXEC Max Conn'' limit is reached, another php connection will be created. ''PHP suEXEC Max Conn'' should always be set to a value that is less than the CloudLinux user account EP limit. A high ''PHP suEXEC Max Conn'' value doesn't necessarily result in a performance gain. A lot of the time, setting this too high may over kill the server. Good practice is to start it at 5 or 10 and monitor the real time stats for your busiest domain during the peak traffic time. If the waitQ is constantly > 0, ''PHP suEXEC Max Conn'' should be gradually increased but it must always be less than the EP limit for all LVE accounts. ''PHP suEXEC Max Conn'' is a global setting which will impact all shared hosting accounts. |
- | For shared hosting environment, "PHP suEXEC Max Conn" should not be set to too high. Generally 5 or 10, normally not over 50. If PHP suEXEC Max Conn reached, it won't bring down the server, but only placed extra php connection "PHP suEXEC Max Conn" should be always less than Cloud Linux user account EP limit. High "PHP suEXEC Max Conn" setting doen't necessary mean the performance gain. A lot of time it may over kill the server. Good practice is to start it from 5 or 10 and monitor the real time stats for your busiest domain during the peak traffic time. If the waitQ is constantly > 0, "PHP suEXEC Max Conn" can be gradually increased but it has to be always less than EP for all LVE accounts. "PHP suEXEC Max Conn" is a global setting which will impact all shared hosting accounts. | + | For non-shared hosting environments, ''PHP suEXEC Max Conn'' can be adjusted to values a little higher such as 50 or even 500 but generally not over 1000. |
+ | |||
+ | The easiest way to determine what the SuExec limit should be is to use the following equation: | ||
+ | |||
+ | <html><center><strong>Max_SuExec = CloudLinux EP / #CPU License</strong></center></html> | ||
+ | |||
+ | For example, if you have an EP limit of 20 and a 2 CPU license: | ||
+ | |||
+ | <html><center><strong>Max_SuExec = 20 / 2</strong></center></html> | ||
+ | |||
+ | The result of this equation is the maximum number that the SuExec field should be; in this case SuExec should be set to 10. If the CloudLinux EP or #CPU License is an odd number ( other than 1 ), be sure to round the SuExec result down as rounding up may go over the maximum CloudLinux EP limit and create issues. | ||
- | For non-shared hosting environment, "PHP suEXEC Max Conn" can be adjusted a little higher, such as 50 or even 500, generally not over 1000. |