Out of swapping space while reading request body!

Discussion in 'General' started by J.T., Jul 20, 2010.

  1. J.T.

    J.T. Well-Known Member

    Got this "out of swapping space while reading request body!" just now on an Enterprise license whilst trying to use a webmail kind of script, sending out an email with two attachments. One just short of 2Mb and one not even 1Mb. PHP upload limit is 12Mb.

    Plenty of disk space and with 4Gb of ram top normally says something like:

    Swap is hardly ever needed.

    Restarting LSWS reenabled me to send out this email. So problem solved in that sense but I'd like to understand this issue better and see if I can prevent it from happening again.

    What space exactly did it run out of?

    Memory I/O Buffer is 120M and we don't have big downloads or uploads going on at any time of day. A 4Mb PDF may be about the biggest download happening and I doubt ever concurrently.

    So given the server ram and hd spec, how did it think it runs out of any space? /tmp/lshttpd/swap filles up with numbered and lettered folders as expected. Restarting lsws doesn't seem to flush old swap folders as those dated before today remain on restart.

    This is on v4.0.14 by the way.

    Until this issue, things were running flawlessly.

    Any insights you can offer?
  2. NiteWave

    NiteWave Administrator

  3. J.T.

    J.T. Well-Known Member

    The error came from the admin UI home page. I logged in after bumping in the 500 server error. I'll have a look in the error logs too. Yes:

    I noticed the exploit and subsequent prompt fix. I have the mod sec rule applied and indeed plan to upgrade later today. Thanks.

    At the server level I have Max Request Body Size (bytes) 500M

    In my mind, with limited understanding of the intricacies, that should be plenty to email 2MB worth of data whilst elsewhere not much is happening.
    Last edited: Jul 21, 2010
  4. mistwang

    mistwang LiteSpeed Staff

    Can it be reliably reproduced? If yes, we can take a closer look at it.
  5. J.T.

    J.T. Well-Known Member

    It happened a few weeks after the last restart so it seems I need to wait a few weeks again and see if it recurs on the new version. I'll keep an eye on it and report back if anything comes up.
  6. mistwang

    mistwang LiteSpeed Staff

    Maybe it is a bug of internal swapping memory usage tracking, lshttpd thought swapping memory has been used up, but actually not. we will add more logging when it happens
  7. J.T.

    J.T. Well-Known Member

    Perhaps the real time statistics can show how much free swapping memory it *thinks* it has available. As part of preventative warnings, it can say stuff like:

    - 80% of swapping space used
    - XYZ VHost 90% of concurrent connections used
    - etc.

    That helps us troubleshoot before it even happens.

Share This Page