PHP suEXEC Max Conn and Litespeed restarts, best setting ?

Monarobase

Well-Known Member
#1
Hello,

We run on our CloudLinx 6 + cPanel + Litespeed server 2 types of accounts, the normal account which is allowed 50 entry processes and the high end account which is allowed 100 entry processes.

We currently have PHP suEXEC Max Conn set to 100 because we want to allow accounts with 100 EP to be able to use all 100.

What can we do to prevent litespeed from restarting each time a user hits his max entry processes while at the same time makeing sure Litespeed is always up and running ?

At the moment we have a limited number of accounts on this server and users don't hit their limits very often, but I can see this becomming a problem if in the future multiple accounts have 503 errors at the same time…

Isn't there a way for litespeed to detect when it's a CloudLinux ressource limit error and ignore it ? Should we turn off the 503 automatic restart ? If so what should we do to make sure it's always running ?

Thanks
 

Monarobase

Well-Known Member
#3
Yes, but in this case I would need to be able to increase the litespeed's limit on a per account basis.

50 EP => Most accounts
100 EP => Some accounts

So I would need to set litespeed's max suexec conn's to 50 on most accounts and to 100 on some accounts and set CloudLinux's EP limits to 60 and 110

That's for the entry processes what about the errors that come up with a user goes well over the top and get's 503 errors for too much CPU usage ?

I obviously need a way to tell litespeed to not restart the webserver when the error is caused by CloudLinux's ressource limits
 

Monarobase

Well-Known Member
#4
CloudLinux reminded me that they do not use 503 error messages but 508 errors. 503 error message is only used for Litespeed internal errors.

My problem seems to be a compatibiliy issue between Litespeed and CloudLinux.

Code:
100193347-2013-04-13 19:06:34.226 [NOTICE] [CLIENTIP:51740-0#APVH_DOMAIN.TLD:lsapi] [STDERR] LSAPI: lve_enter() failure, reached resource limit.:: Argument list too long
100193527-2013-04-13 19:06:34.226 [INFO] [CLIENTIP:51740-0#APVH_DOMAIN.TLD:lsapi] connection to [uds://tmp/lshttpd/lsphp5.sock.923988] on request #0, confirmed, 0, associated process: -1, running: 0, error: Connection reset by peer!
100193770:2013-04-13 19:06:34.226 [NOTICE] [CLIENTIP:51740-0#APVH_DOMAIN.TLD:lsapi] Max retries has been reached, 503!
100193899:2013-04-13 19:06:34.226 [NOTICE] [CLIENTIP:51740-0#APVH_DOMAIN.TLD:lsapi] oops! 503 Service Unavailable
Something to do with "lve_enter() failure, reached resource limit.:: Argument list too long"

What can be done to fix this ?
 

NiteWave

Administrator
#5
thanks. more clear. so return error 508 looks to make more sense.
however, it's up to the decision of our development. need investigate other related factors.
 

NiteWave

Administrator
#7
per my understanding, when lsws detect this error
lve_enter() failure, reached resource limit
just throw a 508 error to browser instead of 503.
so the user know that he should upgrade his host plan.

maybe CloudLinux throw 508 error to browser as well ? in case web server is apache. may be best to confirm from them.
 

Monarobase

Well-Known Member
#8
When using Apache there is a 508 error displayed. I don't know how this is achieved and have asked CloudLinux to confirm.

The main problem here is that with a 503 error, that currently happens when a user uses too much CPU or too many entry processes, lsws restarts automaticaly. We need to prevent this from happening. It would also be nice to be able to customise the 508 error page like you can do on Apache to give the user some more details about the problem.
 

Monarobase

Well-Known Member
#9
Here's CloudLinux's answer. I hope it helps find a solution to this :

It is all about how CL works from inside. There is no such thing as error 508. It is our code in mod_hostinglimits for Apache that generates it when lve_enter returns with the error (and it returns with the error when EP limit reached).

LiteSpeed went a different way -- they just retry, and if that fails produce 503 error -- which is also a solution. I prefer ours, but I really don't want to force (nor a have a way too...) our solution on them. It is up to them how to implement such things.
FYI, here is my message open with CloudLinux :

http://www.cloudlinux.com/solutions/forum/messages/forum18/topic546/message2590/#message2590

If you could work together to detect the lve_enter error and not restart the web server every time a user goes well over his CPU limits it would also allow us to set different EP limits per user and just set Litespeed's Suexec max conn per user to a higher value than CloudLinux's highest EP limit.
 
Last edited:

Monarobase

Well-Known Member
#10
I asked CloudLinux how difficult it would be for Litespeed to be able to detect an LVE limitation, here is their answer :

it is a C function provided only by CL with error codes. So, whoever calls it -- always know if it is LVE, if it failed or not, and if failed - why (based on error codes -- which in case of EP limit -- cannot be mistaken)
Based on this, I presume that it is possible for Litespeed to detect CloudLinux's limits being applied and give a 508 error instead of a 503 error thus preventing Litespeed beeing rebooted because of CloudLinux's limits being hit.

Please let me know what your developpers think about the difficulty and their agreement to make Litespeed compatible with Cloudlinux's CPU and EP limitation errors.

A simple 508 error page stating the ressource limit what hit would be great. A 503 error page that doesn't cause litespeed to restart would be sufficient and a 508 error page with a message explaining what the limit was caused by would be the ultime solution.
 
Last edited:

Monarobase

Well-Known Member
#11
Hello,

I've just had a couple of litespeed restarts because of an account going over it's CPU limit (Cloudlinux gives an error with the user's queue waiting for CPU gets too long - an error that their apache module detects and throughs a 508 serveur busy page).

At the moment I don't have many accounts on this server so it doesn't create any noticible problems (except the e-mails that are sent to inform me of the restart) but in the near future I can see this causing problems if multiple accounts get through errors and litespeed restarts every time.

Is there another way I can monitor litespeed is running and run automatic restarts instead of checking for 503 error while I'm waiting for this compatibility issue to be solved ? (like probing from a custom script run on localhost ?)

Do you have an update on if and when Litespeed will be made fully compatible with Cloudlinux's limiting system ?

I can live with increasing all the Entry Process limits to be higher than litespeed's but there would be no point in using Cloudlinux if I can't use CPU limits either…
 
Last edited:
Top