PHP suEXEC Max Conn and Litespeed restarts, best setting ?

Discussion in 'Install/Configuration' started by Monarobase, Apr 13, 2013.

  1. Monarobase

    Monarobase Well-Known Member


    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 ?

  2. NiteWave

    NiteWave Administrator

    hmm... looks no such issue when no CloudLinux?

    it's suggested to set cloulinx's resource limit always greater than litepeed's...
  3. Monarobase

    Monarobase Well-Known Member

    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
  4. Monarobase

    Monarobase Well-Known Member

    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.

    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 ?
  5. NiteWave

    NiteWave Administrator

    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.
  6. Monarobase

    Monarobase Well-Known Member

    What's the problem then ? Is it that litespeed doesn't recognise the 508 error?
  7. NiteWave

    NiteWave Administrator

    per my understanding, when lsws detect this error
    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.
  8. Monarobase

    Monarobase Well-Known Member

    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.
  9. Monarobase

    Monarobase Well-Known Member

    Here's CloudLinux's answer. I hope it helps find a solution to this :

    FYI, here is my message open with CloudLinux :

    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: Apr 15, 2013
  10. Monarobase

    Monarobase Well-Known Member

    I asked CloudLinux how difficult it would be for Litespeed to be able to detect an LVE limitation, here is their answer :

    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: Apr 15, 2013
  11. Monarobase

    Monarobase Well-Known Member


    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: Apr 21, 2013
  12. Monarobase

    Monarobase Well-Known Member


    Have your developers decided if they can implement this easily or not ?

    Do you have some sort of ETA or priority for making Litespeed compatible with CloudLinux ?

    Edit : As this should be in the feature request section I'll create a new feature request, feel free to merge the two topics :)

    Feature request posted here :
    Last edited: May 1, 2013

Share This Page