memory_limit = 1024M, still, Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp

bentael picture bentael · Oct 22, 2013 · Viewed 19.1k times · Source

I know that there is another question with a similar title/error, but i think this is a different problem.

Context:

  • Running wordpress 3.6.1, PHP 5.3.27, MySql 5.1.70, on a shared Linux host, 1gb Memory.
  • .htaccess: suPHP_ConfigPath /home/[username]/public_html
  • php.ini: memory_limit = 512M (I tried 2048M, 1024M, 32M, .. heck even -1)
  • I also tried (ini_set(/* all the values above, in the WordPress index.php */))
  • I disabled ALL plugins, I even re-enabled one by one.
  • I have about 300-400 concurrent connection/users on the site at the same time, on average.
  • I DO NOT have SSH access :/
  • I cannot reproduce the bug locally (On Mac running 'MAMP' and 'ab', I even lower the mem limit locally to 16m.. )
  • the way I know that none of that worked is that, in the /cpanel errorlog screen, I see the Error (in the title) about 3-4 times per minute !!! (12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/infomed/public_html/index.php
  • I already called the hosting company, directnic, and they weren't able to help me much, they suggested few of the solutions that I already tried, they don't support SSH, so that's a dead end for me. I know I can switch hosts, but I am not able to do so at the moment.

Please, all I am asking is to point out any potential other causes that I can investigate, I am out of ideas ... what could use more than 1gb of memory, in a simple Wordpress blog, all plugins disabled, on the home screen? there is no images upload happening, just 2 wp_get_recent_posts each with a limit of 6.

code here

Answer

Steven Leggett picture Steven Leggett · Jan 14, 2014

I have about 300-400 concurrent connection/users on the site at the same time, on average. I DO NOT have SSH access :/

This is your problem.

Shared hosting companies usually limit more than just PHP memory, you could be reaching i/o, and memory limits elsewhere. You could be inside a VM already and reaching that limit, etc. Shared hosting comes cheap but once you start throwing decent traffic at it they generally suspend your account or you start running up against limits.

I'd advise upgrading with that much traffic to something like a VPS, dedicated server or move to cloud based hosting. You're obviously doing something right with the traffic levels so move off quickly :)