LS 4.2.4 + APC Cache weirdness ?

eva2000

Well-Known Member
#1
Have a very weird issue with 2x LiteSpeed/WHM/Cpanel load balanced dedicated servers via haproxy for identically configured web1 + web2 servers. Where web2 doesn't want to properly use APC Cache for php files only within /home/username account

Where each dedicated server is:

  • WHM/cpanel
  • LiteSpeed 4.2.4
  • PHP 5.3.27 mod_php
  • APC 3.1.13

on web2 not working APC Cache.

  1. php files in /usr/local/apache/htdocs get cached by APC Cache according to apc.php
  2. but php files in /home/username/public_html do not get cached by APC Cache
  3. but php files in a new account at /home/username2/public_html DO get cached by APC Cache ?

I'ved checked usual suspects:

1. in /home/username/public_html no htaccess entries for php_admin or php_flags to disable APC Cache. Checked httpd.conf level too

2. copied php.ini from web1 over to web2 to make sure same php.ini settings with identical apc settings

3. checked httpd_config.xml on both web1 and web2 which are identical using beyond compare file comparison tool

I did notice on web 2 ps output that there's 2 groups of lsphp5 while on web1 there is always 1 group of lsphp5. But i have PHP suexec disabled on both web1 and web2 with identical httpd_config.xml files ? So how to diagnose this further ?

Code:
root     25928  0.0  0.0  24736  3860 ?        S<   00:58   0:00 litespeed (lshttpd)
root     25929  0.0  0.0   5904   420 ?        S<   00:58   0:00  \_ httpd (lscgid)
nobody   25930  2.9  0.0  43632  5260 ?        S<l  00:58   0:01  \_ litespeed (lshttpd)
nobody   25936  0.0  0.0 527732  9400 ?        S    00:58   0:00  |   \_ lsphp5                         
nobody   25937 28.3  0.3 597732 50236 ?        S    00:58   0:10  |       \_ lsphp5                         
nobody   25938 30.0  0.2 600760 46824 ?        R    00:58   0:11  |       \_ lsphp5:ome/username/public_html/forum/forumdisplay.php
nobody   25940  5.0  0.2 599892 40796 ?        S    00:58   0:01  |       \_ lsphp5                         
nobody   25970  4.5  0.1 591408 29348 ?        S    00:58   0:01  |       \_ lsphp5                         
nobody   25971 17.6  0.1 589872 32512 ?        S    00:58   0:06  |       \_ lsphp5                         
nobody   25974 16.8  0.1 587436 26092 ?        S    00:58   0:05  |       \_ lsphp5                         
nobody   25975 20.5  0.1 589104 31120 ?        S    00:58   0:06  |       \_ lsphp5                         
nobody   25976 11.7  0.2 597156 36012 ?        S    00:58   0:03  |       \_ lsphp5                         
nobody   25977 22.0  0.2 601416 43964 ?        R    00:58   0:07  |       \_ lsphp5:/home/username/public_html/forum/search.php
nobody   25978 22.0  0.2 590896 33472 ?        S    00:58   0:07  |       \_ lsphp5                         
nobody   25979  7.2  0.1 588856 24380 ?        S    00:58   0:02  |       \_ lsphp5                         
nobody   25933  0.0  0.0  40848  3812 ?        S<l  00:58   0:00  \_ litespeed (lshttpd)
nobody   26008  0.0  0.0 527732  9404 ?        S    00:59   0:00      \_ lsphp5                         
nobody   26009  0.0  0.0 528852  7640 ?        S    00:59   0:00          \_ lsphp5                         
nobody   26010  0.0  0.0 528164  6984 ?        S    00:59   0:00          \_ lsphp5

Code:
pstree -p|egrep "ls|lite"
        |-litespeed(20628)-+-httpd(20629)
        |                  |-litespeed(20630)-+-admin_php(21417)
        |                  |                  |-lsphp5(20636)-+-lsphp5(20637)
        |                  |                  |               |-lsphp5(20638)
        |                  |                  |               |-lsphp5(20640)
        |                  |                  |               |-lsphp5(20641)
        |                  |                  |               |-lsphp5(20642)
        |                  |                  |               |-lsphp5(20645)
        |                  |                  |               |-lsphp5(20647)
        |                  |                  |               |-lsphp5(20652)
        |                  |                  |               |-lsphp5(20656)
        |                  |                  |               |-lsphp5(20659)
        |                  |                  |               |-lsphp5(20663)
        |                  |                  |               |-lsphp5(20690)
        |                  |                  |               |-lsphp5(20691)
        |                  |                  |               |-lsphp5(20692)
        |                  |                  |               |-lsphp5(21416)
        |                  |                  |               |-lsphp5(21482)
        |                  |                  |               |-lsphp5(21483)
        |                  |                  |               |-lsphp5(21484)
        |                  |                  |               |-lsphp5(21485)
        |                  |                  |               |-lsphp5(21486)
        |                  |                  |               `-lsphp5(21487)
        |                  |                  |-{litespeed}(20631)
        |                  |                  `-{litespeed}(20632)
        |                  `-litespeed(20633)-+-lsphp5(20778)---lsphp5(20781)
        |                                     |-{litespeed}(20634)
        |                                     `-{litespeed}(20635)

vs

on web 1 working APC Cache

Code:
root     11630  0.0  0.0  24740  3864 ?        S<   00:37   0:00 litespeed (lshttpd)
root     11631  0.0  0.0   5904   416 ?        S<   00:37   0:00  \_ httpd (lscgid)
nobody   11632  3.5  0.0 136216  8612 ?        S<l  00:37   0:48  \_ litespeed (lshttpd)
nobody   11638  0.0  0.0 527732  9404 ?        S    00:37   0:00  |   \_ lsphp5                         
nobody   11640 14.9  0.3 602196 63876 ?        S    00:37   3:24  |   |   \_ lsphp5                         
nobody   11641  9.3  0.2 591676 49264 ?        S    00:37   2:07  |   |   \_ lsphp5                         
nobody   11642 12.2  0.2 589388 48732 ?        S    00:37   2:46  |   |   \_ lsphp5                         
nobody   11643 17.8  0.3 596600 60176 ?        S    00:37   4:03  |   |   \_ lsphp5                         
nobody   11647 12.2  0.3 594592 56564 ?        S    00:37   2:47  |   |   \_ lsphp5                         
nobody   11652 17.2  0.3 596652 57308 ?        S    00:37   3:56  |   |   \_ lsphp5                         
nobody   11695 10.9  0.3 595356 52448 ?        S    00:38   2:27  |   |   \_ lsphp5                         
nobody   11705 13.6  0.2 590128 47596 ?        S    00:38   2:56  |   |   \_ lsphp5                         
nobody   11915 14.6  0.2 592708 48316 ?        S    00:41   2:48  |   |   \_ lsphp5                         
nobody   11916 11.8  0.2 588300 44788 ?        S    00:41   2:15  |   |   \_ lsphp5                         
nobody   11917 17.6  0.2 588108 46692 ?        S    00:41   3:22  |   |   \_ lsphp5                         
nobody   11918 14.4  0.2 589916 45304 ?        S    00:41   2:45  |   |   \_ lsphp5                         
nobody   11919 15.1  0.2 589400 46068 ?        S    00:41   2:54  |   |   \_ lsphp5                         
nobody   12212 14.2  0.2 588300 43620 ?        R    00:48   1:41  |   |   \_ lsphp5:/home/username/public_html/forum/showthread.php
nobody   12213 16.4  0.2 587164 43120 ?        S    00:48   1:57  |   |   \_ lsphp5                         
nobody   12752 20.0  0.1 596444 30552 ?        S    01:00   0:02  |   |   \_ lsphp5                         
nobody   12753 27.5  0.1 587748 24800 ?        S    01:00   0:03  |   |   \_ lsphp5                         
nobody   12754 19.4  0.2 596836 36040 ?        S    01:00   0:02  |   |   \_ lsphp5                         
nobody   12755 10.7  0.1 589132 21224 ?        S    01:00   0:01  |   |   \_ lsphp5                         
lsadm    12426  0.1  0.0  27552 10244 ?        S    00:53   0:00  |   \_ /usr/local/lsws/admin/fcgi-bin/admin_php
nobody   11635  0.0  0.0  40852  3504 ?        S<l  00:37   0:00  \_ litespeed (lshttpd)

Code:
pstree -p|egrep "ls|lite"
        |-litespeed(24413)-+-httpd(24414)
        |                  |-litespeed(24415)-+-lsphp5(24774)-+-lsphp5(24776)
        |                  |                  |               |-lsphp5(24777)
        |                  |                  |               |-lsphp5(24779)
        |                  |                  |               |-lsphp5(24782)
        |                  |                  |               |-lsphp5(24783)
        |                  |                  |               |-lsphp5(24784)
        |                  |                  |               |-lsphp5(24785)
        |                  |                  |               |-lsphp5(24792)
        |                  |                  |               |-lsphp5(24793)
        |                  |                  |               |-lsphp5(24796)
        |                  |                  |               |-lsphp5(24797)
        |                  |                  |               |-lsphp5(24798)
        |                  |                  |               `-lsphp5(24988)
        |                  |                  |-{litespeed}(24416)
        |                  |                  `-{litespeed}(24417)
        |                  `-litespeed(24418)-+-{litespeed}(24419)
        |                                     `-{litespeed}(24420)
 

NiteWave

Administrator
#2
I did notice on web 2 ps output that there's 2 groups of lsphp5 while on web1 there is always 1 group of lsphp5. But i have PHP suexec disabled on both web1 and web2 with identical httpd_config.xml files ? So how to diagnose this further ?
yes, it looks weird.

on web1, there should be a lsphp5 process group under litespeed(24418)
the only reason is that the requests number is not enough so only 1 lsphp5 process group(under litespeed(24415)) is enough ?

if so, you can do ab test on web1, just for hello.php, see if the 2nd lsphp5 process group will start off.
 

eva2000

Well-Known Member
#3
well it's live busy forum so ab tests isn't ideal

interesting if i switch web2 from litespeed to apache, then APC Cache works 100% !
 

eva2000

Well-Known Member
#5
Cheers.. switching to suexec daemon mode seem to have got web2 APC Cache working http://blog.litespeedtech.com/2012/09/11/lsws-4-2-introduces-php-suexec-daemon-mode/ :)

Strange that web1 would work with APC and it isn't using suexec daemon mode and file comparison of both web1 and web2 are same for httpd_config.xml ?

web1 looks like this now

Code:
pstree -pun|egrep "ls|lite"
        |-litespeed(6066)-+-httpd(6067)
        |                 |-lsphp5(6070)-+-lsphp5(6078,nobody)
        |                 |              |-lsphp5(6079,nobody)
        |                 |              |-lsphp5(6080,nobody)
        |                 |              |-lsphp5(6081,nobody)
        |                 |              |-lsphp5(6082,nobody)
        |                 |              |-lsphp5(6086,nobody)
        |                 |              |-lsphp5(6113,nobody)
        |                 |              |-lsphp5(6114,nobody)
        |                 |              |-lsphp5(6115,nobody)
        |                 |              |-lsphp5(6118,nobody)
        |                 |              |-lsphp5(6120,nobody)
        |                 |              |-lsphp5(6121,nobody)
        |                 |              |-lsphp5(6122,nobody)
        |                 |              |-lsphp5(6123,nobody)
        |                 |              |-lsphp5(6192,nobody)
        |                 |              |-lsphp5(6216,nobody)
        |                 |              |-lsphp5(6886,nobody)
        |                 |              |-lsphp5(6887,nobody)
        |                 |              |-lsphp5(6888,nobody)
        |                 |              |-lsphp5(7076,nobody)
        |                 |              `-lsphp5(7114,nobody)
        |                 |-litespeed(6071,nobody)-+-lsphp4(6072)
        |                 |                        |-{litespeed}(6073)
        |                 |                        `-{litespeed}(6074)
        |                 `-litespeed(6075,nobody)-+-{litespeed}(6076)
        |                                          `-{litespeed}(6077)
web2 looks like this now

Code:
pstree -pun|egrep "ls|lite"
        |-litespeed(14029)-+-httpd(14030)
        |                  |-lsphp5(14033)-+-lsphp5(14041,nobody)
        |                  |               |-lsphp5(14042,nobody)
        |                  |               |-lsphp5(14043,nobody)
        |                  |               |-lsphp5(14073,nobody)
        |                  |               |-lsphp5(14074,nobody)
        |                  |               |-lsphp5(14099,nobody)
        |                  |               |-lsphp5(14100,nobody)
        |                  |               |-lsphp5(14101,nobody)
        |                  |               |-lsphp5(14108,nobody)
        |                  |               |-lsphp5(14109,nobody)
        |                  |               |-lsphp5(14110,nobody)
        |                  |               |-lsphp5(14111,nobody)
        |                  |               |-lsphp5(14112,nobody)
        |                  |               |-lsphp5(14113,nobody)
        |                  |               |-lsphp5(14114,nobody)
        |                  |               |-lsphp5(14115,nobody)
        |                  |               `-lsphp5(14148,nobody)
        |                  |-litespeed(14034,nobody)-+-lsphp4(14036)
        |                  |                         |-{litespeed}(14037)
        |                  |                         |-{litespeed}(14038)
        |                  |                         `-admin_php(14158,lsadm)
        |                  `-litespeed(14035,nobody)-+-{litespeed}(14039)
        |                                            `-{litespeed}(14040)
 
Last edited:

NiteWave

Administrator
#6
from the output of pstree, lsphp5 of both web1 and web2 are running in daemon mode.

lsphp5 may be defined in virtual host -> External App, in this case it's not in httpd_config.xml which contains server level external app definitions only.
 
Top