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

Go Back   LiteSpeed Support Forums > External Applications > PHP > lsphp4 using high CPU

Reply
 
Thread Tools Display Modes
  #21  
Old 03-21-2008, 06:57 AM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
The high load, I haven't noticed much difference (as many have experienced) after replacing Apache. Before, Apache processes with mod_php was using a lot of ram, not high CPU usage like it is now with lsphp process...

Last edited by anewday; 03-21-2008 at 07:15 AM..
Reply With Quote
  #22  
Old 03-21-2008, 07:55 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
That's because PHP requests has all been handled by one or two lsphp processes, while with Apache mod_php, that load has been distributed among many Apache httpd processes. If add all the cpu usage of httpd processes up, it is higher than lshttpd + lsphp.
Reply With Quote
  #23  
Old 03-21-2008, 08:13 AM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
I don't ever remembering the apache processes using high CPU, even when all added together it's much less than lsphp4 or lsphp5. Here's an output of the ps aux command from a while ago.

Code:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
nobody 27384 0.3 2.0 33300 20912 ? SN Oct25 18:21 /usr/local/apache/bin/httpd -DSSL
nobody 27386 0.3 2.0 33048 20896 ? SN Oct25 21:34 /usr/local/apache/bin/httpd -DSSL
nobody 27387 0.3 2.0 33312 21684 ? SN Oct25 20:37 /usr/local/apache/bin/httpd -DSSL
nobody 27393 0.3 1.8 32564 18948 ? SN Oct25 17:01 /usr/local/apache/bin/httpd -DSSL
nobody 27394 0.3 1.9 32844 19684 ? SN Oct25 17:41 /usr/local/apache/bin/httpd -DSSL
nobody 27395 0.3 1.8 32616 19244 ? SN Oct25 17:56 /usr/local/apache/bin/httpd -DSSL
nobody 27397 0.3 1.7 32972 18484 ? SN Oct25 18:20 /usr/local/apache/bin/httpd -DSSL
nobody 27398 0.3 1.7 32960 18568 ? SN Oct25 19:17 /usr/local/apache/bin/httpd -DSSL
nobody 27399 0.3 1.7 32212 17956 ? SN Oct25 17:40 /usr/local/apache/bin/httpd -DSSL
nobody 28012 0.3 1.8 32756 18888 ? SN Oct25 17:13 /usr/local/apache/bin/httpd -DSSL
nobody 30931 0.3 1.8 32912 18724 ? SN Oct25 20:44 /usr/local/apache/bin/httpd -DSSL
nobody 30932 0.3 1.8 32880 18620 ? SN Oct25 19:04 /usr/local/apache/bin/httpd -DSSL
nobody 30933 0.2 1.8 32652 18628 ? SN Oct25 16:27 /usr/local/apache/bin/httpd -DSSL
nobody 19565 0.4 1.7 32936 18572 ? SN Oct28 9:59 /usr/local/apache/bin/httpd -DSSL
nobody 31529 0.4 1.4 32064 15080 ? SN 11:07 1:16 /usr/local/apache/bin/httpd -DSSL
nobody 610 0.2 1.3 32104 13520 ? SN 11:25 0:32 /usr/local/apache/bin/httpd -DSSL
nobody 1151 0.0 0.2 29604 2396 ? SN 11:30 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 10538 0.5 1.6 32520 16904 ? SN 13:02 0:46 /usr/local/apache/bin/httpd -DSSL
nobody 13460 0.3 1.2 32160 12504 ? SN 13:39 0:20 /usr/local/apache/bin/httpd -DSSL
nobody 20294 0.0 0.2 29604 2184 ? SN 14:40 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24565 0.1 0.7 31668 8164 ? SN 15:21 0:00 /usr/local/apache/bin/httpd -DSSL
nobody 24571 0.0 0.2 29464 2168 ? SN 15:21 0:00 /usr/local/apache/bin/httpd -DSSL
I haven't noticed a difference in load after using LiteSpeed. It still ranges from 1-2 on average during the peak times.

Last edited by anewday; 03-21-2008 at 08:18 AM..
Reply With Quote
  #24  
Old 03-21-2008, 08:25 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Are you using PHP suexec with LiteSpeed, sometimes, PHP may have permission problem and may lead to higher load.
Some PHP code uses disk cache, for some reason, it causes high load problem when there is permission problem.
Reply With Quote
  #25  
Old 03-21-2008, 08:49 AM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
Quote:
Originally Posted by mistwang View Post
Are you using PHP suexec with LiteSpeed, sometimes, PHP may have permission problem and may lead to higher load.
Some PHP code uses disk cache, for some reason, it causes high load problem when there is permission problem.
Yes I'm using that with LiteSpeed. I only run one mysql/php forum and another small static on my dedicated server.

From WHM > CPU/Memory/MySQL Usage

Top Process %CPU 61.0 lsphp5
Top Process %CPU 56.0 lsphp5
Top Process %CPU 49.0 lsphp5

Last edited by anewday; 03-21-2008 at 09:00 AM..
Reply With Quote
  #26  
Old 03-21-2008, 09:17 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Try turning off "php suexec", since you only have one main site. And do not compare php5 with php4.
Reply With Quote
  #27  
Old 03-21-2008, 09:31 AM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
I turned it off before to no avail before I enabled it yesterday. Tried it on both php4 and php5, built with the same config parameters in the GUI.
Reply With Quote
  #28  
Old 03-21-2008, 03:32 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Are you using similar php.ini for both mod_php and lsphp4, except for the part of eaccelerator?
Reply With Quote
  #29  
Old 03-21-2008, 03:51 PM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
Yes, I copied the php.ini as you instructed but the cpu spikes were happening with the default php.ini it came with. I just changed a few settings on that file.
Reply With Quote
  #30  
Old 03-21-2008, 03:56 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
the opcode cache will work better if you turn off PHP suexec. For a server hosting one main PHP site, I would turn it off.
Reply With Quote
Reply

Tags
cpu, high, load, lsphp4, lsphp5, usage

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 02:43 AM.



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