LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > litespeed PHP memory_limit not being recognised ??

Reply
 
Thread Tools Display Modes
  #11  
Old 02-25-2010, 11:49 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
if 503 error is due to consistent PHP process crash, you can add environment variable

LSAPI_ALLOW_CORE_DUMP

to lsphp5 external app configuration to let PHP dump a core file.
http://www.litespeedtech.com/php-litespeed-sapi.html

then check the core file with
gdb /usr/local/lsws/fcgi-bin/lsphp5 core_file_name
bt

It lists the stack call backs when PHP crashes, you can get some clue from it.


Latest 4.0.13 build reduce some 503 error for busy site. you can do a manual upgrade.
Reply With Quote
  #12  
Old 01-26-2012, 06:52 PM
csdco csdco is offline
Member
 
Join Date: Jun 2011
Posts: 14
This seems like a bug. The 400M soft memory value is being recognized as 40 megabytes.
Reply With Quote
  #13  
Old 01-27-2012, 12:51 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
Quote:
Originally Posted by csdco View Post
This seems like a bug. The 400M soft memory value is being recognized as 40 megabytes.
please elaborate or post your screenshot here.
Reply With Quote
  #14  
Old 01-27-2012, 12:54 PM
csdco csdco is offline
Member
 
Join Date: Jun 2011
Posts: 14
Okay. With no opcode cache in place, I have used php.ini to set the memory limit to 512M. phpinfo() reports that this is the memory limit.

When I run out of memory, say by working with a large data set, PHP reports that the allocated memory was just under 40M. How can this be? I checked the soft limit -- this was set to 400M. I changed this to 4000M and I'm able to perform the same task just fine.

Edit: I also set this to 419430400 so that it would just use 400M defined in bytes and it works as expected. The "M" doesn't seem to be working as expected.
Reply With Quote
  #15  
Old 01-27-2012, 03:01 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
Quote:
Originally Posted by csdco View Post
...

When I run out of memory, say by working with a large data set, PHP reports that the allocated memory was just under 40M. How can this be? I checked the soft limit -- this was set to 400M. I changed this to 4000M and I'm able to perform the same task just fine.

Edit: I also set this to 419430400 so that it would just use 400M defined in bytes and it works as expected. The "M" doesn't seem to be working as expected.
you can verify the softlimit by run 'ulimit -a' in php (see below). iow, make a request such as http://your.server.com/test.php and check the size of virtual memory which should reflect soft memory limit in lsphp5.
# cat test.php
<?php
$ulimit=`ulimit -a`;
echo "<pre>$ulimit</pre>";
?>

Last edited by webizen; 01-27-2012 at 08:25 PM..
Reply With Quote
  #16  
Old 01-31-2012, 05:19 AM
Bono Bono is offline
Senior Member
 
Join Date: Jan 2009
Posts: 75
It looks like this feature is totally broken. In PHP config I have set 256MB memory limit I don't use any opcode cache until I fix this issue.
In ext app for PHP 5 soft limit was 450 and now I raised it to 600MB.

And if I check logs I see there is 128mb memory limit.

[31-Jan-2012 13:39:25] PHP Fatal error: Out of memory (allocated 122683392) (tried to allocate 20314 bytes) in /home/site/public_html/libraries/joomla/database/database/mysql.php on line 462

My memory stats:
total used free shared buffers cached
Mem: 3927 3665 261 0 185 1931
-/+ buffers/cache: 1548 2378
Swap: 2047 215 1831

EDIT: now I raised soft to 600 and hard to 800 I get that I'm hitting limit at 256MB.
Memory_limit in PHP is 256MB.

[31-Jan-2012 14:45:48] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 24 bytes) in /home/site/public_html/libraries/joomla/database/database/mysql.php on line 462,

Memory_limit in PHP is raised to 384MB, so now I will see what will happen.

Last edited by Bono; 01-31-2012 at 05:55 AM..
Reply With Quote
Reply

Tags
litespeed, memory_limit, php, php.ini, whm

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:34 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.