mysql query is fast on apache not litespeed ?

bhanuprasad1981

Well-Known Member
#1
hi something is really puzzling me, i am using litespeed past 1 month , after switching to litespeed with suexec enabled i saw that mysql queries are very slow, i thought it is io issue or something and was planning to upgrade hdd to ssd or other 15k ones, but strange thing happened i had to switch to apache, for some reason ,while server was running on apache i was surprised to see my vbulletin sites are really loading fast :eek: , what may be the issue ?
 

mistwang

LiteSpeed Staff
#4
150 is too high, you should try something like 10 or 20 at most for shared hosting server.
check the number of PHP processes running. Check real time status report see if WaitQ stay at zero at peak hours.
It is completely between PHP and MySQL, make sure you use the same PHP mysql client library for LiteSpeed and Apache PHP.
 

bhanuprasad1981

Well-Known Member
#5
ok as you said i switched back to litespeed, reduced connections to 30,where can i see how many php process are running ?

and sir what you mean by "make sure you use the same PHP mysql client library for LiteSpeed and Apache PHP. "
 

NiteWave

Administrator
#6
comparing output of phpinfo() under apache and litespeed, check mysql related info, if they are same, then it's sure "you use the same PHP mysql client library for LiteSpeed and Apache PHP".
 

bhanuprasad1981

Well-Known Member
#7
details

sorry sir can you please cehck ifference , i am nota professional sysadmin :(
mysql settings in apache :-

Code:
MySQL Support	enabled
Active Persistent Links 	0
Active Links 	0
Client API version 	5.0.89
MYSQL_MODULE_TYPE 	external
MYSQL_SOCKET 	/var/lib/mysql/mysql.sock
MYSQL_INCLUDE 	-I/usr/include/mysql
MYSQL_LIBS 	-L/usr/lib64 -lmysqlclient

Directive	Local Value	Master Value
mysql.allow_persistent	On	On
mysql.connect_timeout	60	60
mysql.default_host	no value	no value
mysql.default_password	no value	no value
mysql.default_port	no value	no value
mysql.default_socket	no value	no value
mysql.default_user	no value	no value
mysql.max_links	Unlimited	Unlimited
mysql.max_persistent	Unlimited	Unlimited
mysql.trace_mode	Off	Off
mysqli settings in apache

Code:
MysqlI Support	enabled
Client API library version 	5.0.89
Client API header version 	5.0.89
MYSQLI_SOCKET 	/var/lib/mysql/mysql.sock

Directive	Local Value	Master Value
mysqli.default_host	no value	no value
mysqli.default_port	3306	3306
mysqli.default_pw	no value	no value
mysqli.default_socket	no value	no value
mysqli.default_user	no value	no value
mysqli.max_links	Unlimited	Unlimited
mysqli.reconnect	Off	Off
mysql settings in litespeed :-

Code:
MySQL Support	enabled
Active Persistent Links 	0
Active Links 	0
Client API version 	5.0.89
MYSQL_MODULE_TYPE 	external
MYSQL_SOCKET 	/var/lib/mysql/mysql.sock
MYSQL_INCLUDE 	-I/usr/include/mysql
MYSQL_LIBS 	-L/usr/lib64 -lmysqlclient

Directive	Local Value	Master Value
mysql.allow_persistent	On	On
mysql.connect_timeout	60	60
mysql.default_host	no value	no value
mysql.default_password	no value	no value
mysql.default_port	no value	no value
mysql.default_socket	no value	no value
mysql.default_user	no value	no value
mysql.max_links	Unlimited	Unlimited
mysql.max_persistent	Unlimited	Unlimited
mysql.trace_mode	Off	Off

mysqli settings in litespeed :-

Code:
MysqlI Support	enabled
Client API library version 	5.0.89
Client API header version 	5.0.89
MYSQLI_SOCKET 	/var/lib/mysql/mysql.sock

Directive	Local Value	Master Value
mysqli.default_host	no value	no value
mysqli.default_port	3306	3306
mysqli.default_pw	no value	no value
mysqli.default_socket	no value	no value
mysqli.default_user	no value	no value
mysqli.max_links	Unlimited	Unlimited
mysqli.reconnect	Off	Off
 

NiteWave

Administrator
#8
OK for MySQL --- litespeed and apache are matching
ok as you said i switched back to litespeed, reduced connections to 30,where can i see how many php process are running ?
pd -ef or pstree -p
can see how many lsphp5 processes are running

you may try eAccelerator to speed up php code execution.

the main difference of your site may be apache running on mod_php(not suEXEC or mod_suphp) while litespeed running in suEXEX mode?
 

bhanuprasad1981

Well-Known Member
#9
OK for MySQL --- litespeed and apache are matching

pd -ef or pstree -p
can see how many lsphp5 processes are running

you may try eAccelerator to speed up php code execution.

the main difference of your site may be apache running on mod_php(not suEXEC or mod_suphp) while litespeed running in suEXEX mode?
i dont see much difference if i disable suexec in litespeed :(, what may be other possible issues?
 
#11
i have xcache , but it is not working in litespeed :(, manual build of php is not working with my requirements, i am using whm plugin option to copy apache modules.
 
Top