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
  #11  
Old 03-20-2008, 02:34 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
You should copy the php.ini used by Apache mod_php then add the eaccelerator configuration.

From command line do "./lsphp4 -v" to make sure there is no error message complaining failed to load eaccelerator.so
You can try removing "extension_dir" configuration in php.ini.
Reply With Quote
  #12  
Old 03-20-2008, 04:55 PM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
I copied the php.ini from /usr/local/Zend/etc/ to /usr/local/lsws/lsphp4/lib/
removed the Zend lines and added eaccelerator lines.

Code:
root@server [/usr/local/lsws/fcgi-bin]# ./lsphp4 -v
PHP 4.4.8 (litespeed) (built: Mar 20 2008 13:29:02)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
Code:
root@server [/usr/local/apache/logs]# cat stderr.log |grep eacc

PHP Warning:  Unknown(): Unable to load dynamic library './eaccelerator.so' - ./eaccelerator.so: cannot open shared object file: No such file 
or directory in Unknown on line 0PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug
-non-zts-20060613eaccelerator.so' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613eaccelerator.so: cannot open shared o
bject file: No such file or directory in Unknown on line 0PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/li
b/php/extensions/no-debug-non-zts-20060613/eaccelerator.so' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerat
or.so: cannot open shared object file: No such file or directory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0curl: try 'curl --help' or 'curl --manual' for more information
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so
' - .//usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so
' - .//usr/local/lsws/lsphp4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so
' - .//usr/local/lsws/lsphp4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library './/usr/local/lsws/lsphp4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so
' - .//usr/local/lsws/lsphp4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so: cannot open shared object file: No such file or dir
ectory in Unknown on line 0/usr/local/apache/bin/httpd_ls_bak: invalid option -- k
PHP Warning:  Unknown(): Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20020429//usr/local/lsws/lsphp4/lib/ph
p/extensions/no-debug-non-zts-20020429/eaccelerator.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20020429//usr/local/lsws/lsphp4/lib/p
hp/extensions/no-debug-non-zts-20020429/eaccelerator.so: cannot open shared object file: No such file or directory in Unknown on line 0

Last edited by anewday; 03-20-2008 at 05:16 PM..
Reply With Quote
  #13  
Old 03-20-2008, 05:06 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
remove the "extension_dir" configuration in php.ini

try ./lsphp4 -i

until eaccelerator extension appear in the output.
Reply With Quote
  #14  
Old 03-20-2008, 05:21 PM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
eaccelerator still does not appear in the output after removing the extension_dir line in php.ini
Reply With Quote
  #15  
Old 03-20-2008, 07:20 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
check if the right php.ini has been used. And the right path has been used for eaccelerator.so, check if the file exist.
Reply With Quote
  #16  
Old 03-20-2008, 07:30 PM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
Default finally working

*whewwwww*

extension_dir = "/usr/local/lsws/lsphp4/lib/php/extensions/no-debug-non-zts-20020429"
extension="eaccelerator.so"

eaccelerator.shm_size="48"
eaccelerator.cache_dir="/tmp/lswseaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

I got an example from another site and changed it.

Thanks for helping!

Last edited by anewday; 03-20-2008 at 07:34 PM..
Reply With Quote
  #17  
Old 03-20-2008, 07:56 PM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
Ok, not much have changed since I got eaccelerator working. The lsphp4 process still spikes the cpu usage.
Reply With Quote
  #18  
Old 03-20-2008, 08:04 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Have you setup /tmp/lswseaccelerator? any file got created?
Reply With Quote
  #19  
Old 03-20-2008, 08:22 PM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
Yes, I made that folder and set the permissions correctly, there are many folders and files created. Could it be the fact that I put too many configure parameters during the PHP build?

Also, I see this on the process list:

1804 nobody 16 0 0 0:00.04 0.2 7672 5324 1504 S admin_php -c ../conf/php.ini

why is it showing that path to php.ini file?

Last edited by anewday; 03-20-2008 at 08:59 PM..
Reply With Quote
  #20  
Old 03-21-2008, 02:25 AM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
I'm curious, are you really worried about a high overall load or just because you see php separately now? with apache you probably had mod_php loaded into apache and therefore only saw apache processes with high load. with litespeed php is run separately and gets requests through lshttpd.
If you got lots of php pages / scripts requested than surely php is running high .
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 03:50 PM.



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