[Solved] Drastically Increased PHP RAM Usage after Rebuild, only via LiteSpeed

Discussion in 'General' started by MikeDVB, Feb 22, 2012.

  1. MikeDVB

    MikeDVB New Member

    Hello,

    This issue is quite odd and I've not yet been able to track down what is causing it. Users on a specific server running Drupal and one running Xenforo are reporting out of memory errors after recently rebuilding PHP 5.2.17 (to fix a GD Image issue). The configuration and options were exactly the same and we did a rebuild via Easy Apache followed by a rebuild using the LiteSpeed WHM plugin.

    What is especially strange for me on this, is that I am 100% unable to reproduce the error via the CLI when using the php binary itself or the lsphp binary in the /usr/local/lsws/fcgi-bin directory.

    When accessing the page using LiteSpeed (i.e. via the browser) the error happens about 50% of the time, and it is outputting errors like this:
    Note that this did not happen before the PHP rebuild, and happens regularly after. This is 519 MB it's trying to allocate which is definitely abnormal. The limit set in the php.ini is actually 128 MB but the limit of 134217728 bytes is 134.2 MB so it looks like perhaps the script is setting it's own RAM limit. A phpinfo(); is displaying the correct local value - even if I set it to 1024M it will still fail.

    I put a pause in the beginning of one of the scripts that is regularly having issues so I could get the PID and strace it and I'm seeing this (I redacted account specific information): (in next post due to length)
    Last edited: Feb 22, 2012
  2. MikeDVB

    MikeDVB New Member

    (10 characters outside of quote)
    Last edited: Feb 22, 2012
  3. MikeDVB

    MikeDVB New Member

    (10 chars outside of quote)
    Last edited: Feb 22, 2012
  4. MikeDVB

    MikeDVB New Member

    (10 chars outside of quote)
    Last edited: Feb 22, 2012
  5. MikeDVB

    MikeDVB New Member

    (10 chars outside of quote)
  6. MikeDVB

    MikeDVB New Member

    The message displayed in the browser is:
    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261847360 bytes) in Unknown on line 0

    When I run this via php 5.3 the issue does not occur, and if I run it via php 5.2 on the CLI the issue does not occur. This is only happening when it's being processed by LiteSpeed. I'm not necessarily saying this *is* a LiteSpeed issue but I'm not sure where else to look. I know cPanel isn't going to be helpful because the second they see LiteSpeed they say "Sorry, you're using an unsupported software (support it yourself)."
    Last edited: Feb 22, 2012
  7. MikeDVB

    MikeDVB New Member

    Over the last couple of hours a lot of users are reporting memory exhaustion errors even with very light scripts that shouldn't be using more than a few megabytes. Without any other ideas/suggestions the only thing I can think to do is to roll back the PHP version to see if that resolves it. Hopefully this isn't a bug that PHP has back ported into older versions.

    I'm still open to ideas and suggestions.

    Here is the strace to another script on the same server, which is failing due to memory exhaustion: (pastebinned this one to save length) http://pastebin.com/RzqXUea3
    Last edited: Feb 23, 2012
  8. MikeDVB

    MikeDVB New Member

    I sorted it out, it's cPanel's "homeloader.so"

    Just in case anybody else come across this issue and can't sort it.

    Phew.
  9. mistwang

    mistwang LiteSpeed Staff

    thanks for the heads up.

Share This Page