Troubleshooting¶
Too Many LSPHP Processes¶
First, make sure that LSCache is enabled and verify the cache hit header. Caching should reduce the number of LSPHP processes needed.
Now let's look at the main reason why there may be so many LSPHP processes running.
Max LSPHP processes = SuEXEC max connections * number of OLS workers.
Example
If you have SuEXEC max connections set to 100
and you have 6
OLS workers enabled, you will have a potential six hundred LSPHP processes
You can change both of these settings to dramatically reduce the number of allowed LSPHP processes.
If LSPHP SuEXEC max connections is greater than 10
, try reducing it like so:
maxConns 10
env PHP_LSAPI_CHILDREN=10
This changes the number of max connections and children per worker both to 10
.
Not sure how many workers you need? As a guideline, consider an 8 core server. You would only need one or two OLS workers with that setup. If you have more workers than you need, try reducing them.
Edit /usr/local/lsws/conf/httpd-defaults.conf
and change httpdworkers
to 1
.
Restart OpenLiteSpeed to let your changes take effect:
/usr/local/lsws/bin/lswsctrl restart
Following these settings exactly gives you a max number of 10 LSPHP processes. You can tweak these settings further if necessary.