#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    13
    Rep Power
    0

    Apache Worker MPM configuration help required


    We are currently on Amazon EC2 on Medium Instance. We wanted to know if our Apache

    Worker MPM configuration is correct or do we need to tweak this to best suit our

    requirement:

    Server Configuration:
    Intel(R) Xeon(R) CPU E5430 @ 2.66GHz, 2 cores
    8 GB Ram
    OS: Ubuntu Linux 12.04.1
    Kernel & CPU: Linux 3.2.0-31-virtual on x86_64

    Apache Worker MPM configuration:
    <IfModule mpm_worker_module>
    StartServers 5
    MinSpareThreads 5
    MaxSpareThreads 10
    ThreadLimit 64
    ThreadsPerChild 25
    ServerLimit 688
    MaxClients 688
    MaxRequestsPerChild 10000
    </IfModule>

    KeepAlive Off
    KeepAliveTimeout 5
    TimeOut 300

    Traffic on the server:
    Almost 1000 processes running (High traffic)
    600 processes (Normal traffic)
    No. of Users online:
    150-160 (High traffic)
    90-100 (Normal traffic)

    MySQL CPU usage is around:
    90-100% (high traffic)
    40-50% (normal traffic)

    Also, MySql Max connections: 150

    Could anyone recommend the best possible configuration for Worker MPM. What could be an ideal Max. Clients?

    Do we also need to tweak the MySQL settings?
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    Are you having problems? If not, don't mess with it. If so, tell us what they are.
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    13
    Rep Power
    0
    Originally Posted by jharnois
    Are you having problems? If not, don't mess with it. If so, tell us what they are.
    We generally face issues when the no. of users on the site are more.

    We run a social networking site with a chat module enabled for logged in users. The site is database intensive where most of the load is on the MySQL.

    Typically there are about 100 users online when the site runs normally with all pages loading fast. As the no. of users increase to 150-160, we see sluggishness on the server - the MySQL CPU usage goes to 100%, shows a memory usage of 3.5%, the no. of processes running shows around 1000-1100. That being a cause of concern to us.

    I believe, that if we do the right optimization to the apache server, php settings and mysql settings, the load should come down. Hence, my query.
  6. #4
  7. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    What does top show during these peak times?

    Have you configured Apache's server status handler? What's that look like during peak times?

    Are you hitting your MySQL max connections?

    Are you hitting your Apache MaxClients?

    Are you aware that worker shouldn't be used with MPM? I've seen plenty of people do it, and I've done it, but it's not suppose to be done (reference). Just keep it in mind.

    Do you have a MySQL slow query log?

    What's the response times for a page on your website under no load (in your development environment)?
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    13
    Rep Power
    0
    Top during peak hours: Top

    top - 23:20:19 up 18 days, 10:55, 2 users, load average: 8.86, 8.63, 9.13
    Tasks: 520 total, 3 running, 453 sleeping, 41 stopped, 23 zombie
    Cpu(s): 51.7%us, 21.1%sy, 0.0%ni, 3.7%id, 0.8%wa, 0.0%hi, 1.3%si, 21.4%st
    Mem: 7629500k total, 7469240k used, 160260k free, 229580k buffers
    Swap: 8388604k total, 477152k used, 7911452k free, 3515776k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    24143 mysql 20 0 1405m 250m 5100 S 112 3.4 584:19.40 mysqld
    19283 www-data 20 0 1294m 11m 1664 S 6 0.2 0:00.80 apache2
    25074 root 20 0 553m 17m 4948 S 6 0.2 106:55.28 nginx
    19140 www-data 20 0 1294m 11m 1612 S 6 0.2 0:00.95 apache2
    23212 qaquack 20 0 253m 11m 3356 S 4 0.2 0:03.51 php
    19622 Debian-e 20 0 52044 2864 2112 S 3 0.0 0:00.09 exim4
    13440 qaquack 20 0 254m 13m 3164 S 2 0.2 0:01.00 php
    19512 qaquack 20 0 248m 7644 2456 S 2 0.1 0:00.07 php
    19638 qaquack 20 0 247m 10m 6616 S 2 0.1 0:00.10 php
    8833 qaquack 20 0 251m 10m 3180 S 2 0.1 0:01.72 php
    13455 qaquack 20 0 250m 10m 3092 S 2 0.1 0:01.35 php
    19657 www-data 20 0 1292m 5596 1540 S 2 0.1 0:00.06 apache2
    5466 qaquack 20 0 249m 9744 3236 S 2 0.1 0:01.77 php
    6384 qaquack 20 0 251m 10m 3168 S 2 0.1 0:01.62 php
    15784 qaquack 20 0 251m 10m 3008 S 2 0.1 0:00.42 php
    18139 qaquack 20 0 250m 9608 2600 S 2 0.1 0:00.29 php
    10406 qaquack 20 0 250m 10m 3192 S 1 0.1 0:01.56 php
    29614 qaquack 20 0 251m 10m 3256 S 1 0.1 0:02.50 php
    9090 qaquack 20 0 251m 11m 3176 S 1 0.2 0:01.69 php
    11489 qaquack 20 0 250m 10m 3040 S 1 0.1 0:01.36 php
    19633 Debian-e 20 0 53276 4080 2104 S 1 0.1 0:00.09 exim4
    26697 qaquack 20 0 251m 10m 3044 S 1 0.1 0:04.41 php
    29212 memcache 20 0 381m 66m 860 S 1 0.9 8:28.65 memcached
    4213 qaquack 20 0 253m 13m 3344 S 1 0.2 0:02.06 php
    6652 qaquack 20 0 251m 10m 3348 S 1 0.1 0:01.92 php
    10481 qaquack 20 0 252m 11m 3364 S 1 0.2 0:01.27 php
    18819 qaquack 20 0 249m 9376 3068 S 1 0.1 0:00.20 php
    19479 qaquack 20 0 17616 1620 936 R 1 0.0 0:00.18 top
    19513 qaquack 20 0 253m 12m 2536 S 1 0.2 0:00.04 php
    19516 qaquack 20 0 247m 7120 2512 S 1 0.1 0:00.05 php
    19570 www-data 20 0 1282m 7092 1940 S 1 0.1 0:00.03 apache2
    301 qaquack 20 0 250m 9.9m 3172 S 0 0.1 0:02.31 php
    302 qaquack 20 0 251m 11m 3420 S 0 0.2 0:02.40 php
    303 qaquack 20 0 252m 11m 3252 S 0 0.2 0:02.60 php
    304 qaquack 20 0 251m 10m 3400 S 0 0.1 0:02.42 php
    4214 qaquack 20 0 253m 12m 3264 S 0 0.2 0:02.64 php
    4218 qaquack 20 0 252m 12m 3196 S 0 0.2 0:02.92 php
    Apache server status handler: No. We have not configured this.

    MySql max. connections reached: No. We have configured max. connections to 150. The figure we reached here is 84 checked via MySql tuner.

    Hitting MaxClients: No. We have checked error logs and found nothing on this.

    MySql slow query: We have previously run MySql slow queries and optimized / indexed the ones which were logged as slow queries. As of now, there are hardly any queries which show up in slow queries except 1 or 2 in a day.

    The avg. response time (production): I am not sure how to test this. But tested this on a response testing site. : gave a result of 0.6 seconds.
  10. #6
  11. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    I would recommend configuring the Apache server status so you can get a better idea of what Apache is doing. Yes it adds some overhead, but it's well worth it, particularly when troubleshooting. I would also turn ExtendedStatus on so it will tell you what's being requested. This will tell you whether or not you're hitting an Apache connection limit.

    top shows that your server has had to use swap space at some point, and that's never a good thing on a web server. You'll either have to increase RAM or decrease use of RAM; the latter can be difficult to pinpoint. You're also pushing your CPUs pretty hard.

    PHP sripts are the usual culprit in these situations—and a PHP-based chat script is a good place to start. And often, increasing the RAM and CPUs may allow you to handle more users, but eventually you'll end up in the same situation. That is, these processes will eventually take everything you give them, sometimes without really allowing more users.

    One approach, although likely not feasible, would be to disable the chat portion during peak times to see how that affects the server's performance.

    Is that a custom built chat or something else?
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    13
    Rep Power
    0
    Originally Posted by jharnois
    I would recommend configuring the Apache server status so you can get a better idea of what Apache is doing. Yes it adds some overhead, but it's well worth it, particularly when troubleshooting. I would also turn ExtendedStatus on so it will tell you what's being requested. This will tell you whether or not you're hitting an Apache connection limit.

    top shows that your server has had to use swap space at some point, and that's never a good thing on a web server. You'll either have to increase RAM or decrease use of RAM; the latter can be difficult to pinpoint. You're also pushing your CPUs pretty hard.

    PHP sripts are the usual culprit in these situations—and a PHP-based chat script is a good place to start. And often, increasing the RAM and CPUs may allow you to handle more users, but eventually you'll end up in the same situation. That is, these processes will eventually take everything you give them, sometimes without really allowing more users.

    One approach, although likely not feasible, would be to disable the chat portion during peak times to see how that affects the server's performance.

    Is that a custom built chat or something else?
    Thanks Jharnois for pointing out precisely these things.

    We will setup the apache server status with extendedstatus and see what it shows up.

    Coming to PHP, you are very true. PHP is the main culprit here. Moreso, becuase we have a PHP / MySql based customized chat installed. A few days back, we installed a new chat app which works on Long Polling (Nginx & PushStream based) which has resulted in lowering the usage of PHP. Nonetheless, we are still trying to improve on this front.

    I shall update you once we see what Apache Server status tells us.

    Thanks again and wishing you a very happy new year!
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    13
    Rep Power
    0
    Hi Jharnois,

    Here is the report from the Apache Server Status (part 1):

    Apache Server Status for domanname.in

    Server Version: Apache/2.2.22 (Ubuntu) mod_fcgid/2.3.6 mod_ssl/2.2.22 OpenSSL/1.0.1
    Server Built: Nov 8 2012 21:37:37
    Current Time: Monday, 31-Dec-2012 12:27:07 IST
    Restart Time: Monday, 31-Dec-2012 12:14:33 IST
    Parent Server Generation: 0
    Server uptime: 12 minutes 33 seconds
    Total accesses: 20141 - Total Traffic: 184.0 MB
    CPU Usage: u12.77 s5.31 cu0 cs0 - 2.4% CPU load
    26.7 requests/sec - 250.3 kB/second - 9.4 kB/request
    3 requests currently being processed, 22 idle workers
    _W____W__________W_______.......................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    ................................................................
    Scoreboard Key:
    "_" Waiting for Connection, "S" Starting up, "R" Reading Request,
    "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
    "C" Closing connection, "L" Logging, "G" Gracefully finishing,
    "I" Idle cleanup of worker, "." Open slot with no current process

    Srv PID Acc M CPU SS Req Conn Child Slot Client VHost Request
    0-0 13494 0/5/402 _ 0.12 0 2 0.0 0.10 3.73 54.243.216.72 domainname GET /Register/user-img/resize_1286979384.jpg HTTP/1.0
    0-0 13494 0/4/404 W 0.10 0 0 0.0 0.01 3.46 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    0-0 13494 0/4/409 _ 0.11 0 8 0.0 0.01 3.61 54.243.216.72 domainname GET /home/editmyprofile.php?hobbies=434855224 HTTP/1.0
    0-0 13494 0/4/399 _ 0.10 0 2 0.0 0.05 3.58 54.243.216.72 domainname GET /Register/user-img/resize_1285480599.jpg HTTP/1.0
    0-0 13494 0/4/403 _ 0.11 0 0 0.0 0.11 4.19 54.243.216.72 domainname GET /Register/user-img/resize_1286277183.jpg HTTP/1.0
    0-0 13494 0/4/414 _ 0.10 0 0 0.0 0.07 3.38 54.243.216.72 domainname GET /Register/user-img/resize_1286331365.jpg HTTP/1.0
    0-0 13494 0/4/396 W 0.10 0 0 0.0 0.08 3.85 122.175.35.75 domainname GET /server-status HTTP/1.1
    0-0 13494 0/4/407 _ 0.12 0 0 0.0 0.10 4.14 54.243.216.72 domanname.in GET /newimages/plusi.png HTTP/1.0
    0-0 13494 0/4/405 _ 0.11 0 4 0.0 0.04 4.39 54.243.216.72 domainname GET /home/chatchat/onlinecount1.php?inactivity=pune25m&_=135693
    0-0 13494 0/4/397 _ 0.11 0 1 0.0 0.06 3.76 54.243.216.72 domainname GET /Register/user-img/resize_1285480599.jpg HTTP/1.0
    0-0 13494 0/4/407 _ 0.11 0 1 0.0 0.04 4.54 54.243.216.72 domainname GET /Register/user-img/resize_1285480599.jpg HTTP/1.0
    0-0 13494 0/4/405 _ 0.11 0 2 0.0 0.07 4.31 54.243.216.72 domainname GET /Register/user-img/resize_1285007407.jpg HTTP/1.0
    0-0 13494 0/4/400 _ 0.11 0 1 0.0 0.08 3.74 54.243.216.72 domainname GET /Register/user-img/resize_1348735868.jpg HTTP/1.0
    0-0 13494 0/4/407 _ 0.11 0 1 0.0 0.04 4.73 54.243.216.72 domainname GET /Register/user-img/resize_1286979384.jpg HTTP/1.0
    0-0 13494 0/4/406 _ 0.12 0 41 0.0 0.03 3.83 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    0-0 13494 0/4/415 _ 0.11 0 1 0.0 0.07 4.00 54.243.216.72 domainname GET /Register/user-img/resize_1285480599.jpg HTTP/1.0
    0-0 13494 0/4/407 _ 0.11 0 1 0.0 0.06 5.02 54.243.216.72 domainname GET /Register/user-img/resize_1285007407.jpg HTTP/1.0
    0-0 13494 0/3/403 W 0.07 0 0 0.0 0.06 4.37 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    0-0 13494 0/4/407 _ 0.11 0 2 0.0 0.09 3.59 54.243.216.72 domainname GET /Register/user-img/resize_1286250688.jpg HTTP/1.0
    0-0 13494 0/3/405 _ 0.10 0 2 0.0 0.06 2.63 54.243.216.72 domainname GET /Register/user-img/resize_1285480599.jpg HTTP/1.0
    0-0 13494 0/4/403 _ 0.11 0 0 0.0 0.10 3.63 54.243.216.72 domainname GET /Register/user-img/resize_1286940283.jpg HTTP/1.0
    0-0 13494 0/3/404 _ 0.11 0 176 0.0 0.08 3.60 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    0-0 13494 0/3/401 _ 0.10 0 2 0.0 0.08 4.00 54.243.216.72 domainname GET /Register/user-img/resize_1286250688.jpg HTTP/1.0
    0-0 13494 0/4/398 _ 0.11 0 0 0.0 0.04 3.71 54.243.216.72 domainname GET /Register/user-img/resize_1286277183.jpg HTTP/1.0
    0-0 13494 0/4/406 _ 0.12 0 52 0.0 0.04 3.96 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    1-0 - 0/0/1 . 0.06 751 1 0.0 0.00 0.00 54.243.216.72 domainname GET /favicon.ico HTTP/1.0
    1-0 - 0/0/1 . 0.06 751 2 0.0 0.00 0.03 54.243.216.72 domanname.in GET /copules.jpg HTTP/1.0
    1-0 - 0/0/1 . 0.06 751 471 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    1-0 - 0/0/1 . 0.06 751 315 0.0 0.00 0.03 54.243.216.72 domainname GET /home/users.php?users=chat&target=45fe5eff7144e878826397306
    2-0 - 0/0/1 . 0.06 748 10 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    2-0 - 0/0/1 . 0.01 748 1 0.0 0.00 0.00 54.243.216.72 domainname GET /scripts/sNotify.css HTTP/1.0
    2-0 - 0/0/1 . 0.09 748 198 0.0 0.00 0.01 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    2-0 - 0/0/2 . 0.10 748 2 0.0 0.00 0.03 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    2-0 - 0/0/1 . 0.08 748 2 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    2-0 - 0/0/2 . 0.10 748 4 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/chat.php?action=chatheartbeat&nick=glory&min
    2-0 - 0/0/1 . 0.08 748 6 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/chat.php?action=chatheartbeat&nick=shaarajma
    2-0 - 0/0/1 . 0.01 748 1236 0.0 0.00 0.00 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    2-0 - 0/0/1 . 0.08 748 5 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    2-0 - 0/0/2 . 0.08 748 11 0.0 0.00 0.15 54.243.216.72 domainname POST /home/chatchat/chat.php?action=closechat HTTP/1.0
    2-0 - 0/0/1 . 0.07 748 12 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    2-0 - 0/0/2 . 0.10 748 2 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    2-0 - 0/0/1 . 0.08 748 11 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    2-0 - 0/0/1 . 0.07 748 0 0.0 0.00 0.00 54.243.216.72 domanname.in GET /pop-left.png HTTP/1.0
    2-0 - 0/0/1 . 0.07 748 2 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/chat.php?action=startchatsession&_=135693634
    2-0 - 0/0/2 . 0.08 748 1 0.0 0.00 0.03 54.243.216.72 domainname GET /Register/user-img/resize_1355421824434891141.jpg HTTP/1.0
    2-0 - 0/0/1 . 0.07 748 3 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/onlinecount1.php?inactivity=goodfriend71&_=1
    2-0 - 0/0/2 . 0.11 748 248 0.0 0.00 0.01 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    2-0 - 0/0/1 . 0.01 748 58 0.0 0.00 0.00 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    2-0 - 0/0/2 . 0.10 748 3 0.0 0.00 0.06 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    2-0 - 0/0/1 . 0.07 748 349 0.0 0.00 0.01 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    2-0 - 0/0/2 . 0.10 748 2 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    2-0 - 0/0/1 . 0.06 748 64 0.0 0.00 0.00 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    2-0 - 0/0/1 . 0.08 748 0 0.0 0.00 0.02 54.243.216.72 domainname GET /home/images/scroll_articals.gif HTTP/1.0
    2-0 - 0/0/1 . 0.08 748 15 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/chat.php?action=chatheartbeat&nick=glory&min
    3-0 - 0/0/383 . 17.73 388 2 0.0 0.00 2.78 54.243.216.72 domainname GET /home/chatchat/chat.php?action=startchatsession1&nick=pokal
    3-0 - 0/0/414 . 17.73 388 3 0.0 0.00 5.36 54.243.216.72 domainname GET /home/chatchat/onlinecount1.php?inactivity=goodfriend71&_=1
    3-0 - 0/0/425 . 17.75 388 0 0.0 0.00 3.76 54.243.216.72 domainname GET /Register/user-img/q-male-2.gif HTTP/1.0
    3-0 - 0/0/383 . 17.73 388 334 0.0 0.00 3.04 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    3-0 - 0/0/385 . 17.75 388 48 0.0 0.00 3.29 54.243.216.72 domainname GET /home/readmessage.php?uname=nanka&target=05f3b67c2ebc021800
    3-0 - 0/0/396 . 17.75 388 1 0.0 0.00 2.97 54.243.216.72 domainname GET /home/chatchat/chat.php?action=startchatsession&_=135693668
    3-0 - 0/0/396 . 17.75 388 164 0.0 0.00 3.62 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    3-0 - 0/0/384 . 17.73 388 8 0.0 0.00 3.75 54.243.216.72 domainname POST /home/chatchat/chat.php?action=closechat HTTP/1.0
    3-0 - 0/0/416 . 17.72 388 0 0.0 0.00 4.99 54.243.216.72 domainname GET /home/chat/emotion_image.png HTTP/1.0
    3-0 - 0/0/386 . 17.72 388 3 0.0 0.00 2.93 54.243.216.72 domainname POST /home/chatchat/chat.php?action=closechat HTTP/1.0
    3-0 - 0/0/400 . 17.75 388 2 0.0 0.00 2.54 54.243.216.72 domainname GET /home/chatchat/onlinecount1.php?inactivity=pano&_=135693670
    3-0 - 0/0/400 . 17.73 388 6 0.0 0.00 3.28 54.243.216.72 domainname POST /home/getcount.php HTTP/1.0
    3-0 - 0/0/381 . 17.75 388 1 0.0 0.00 3.39 54.243.216.72 domainname GET /home/chatchat/onlinecount1.php?inactivity=vinay8685&_=1356
    3-0 - 0/0/394 . 17.71 388 61 0.0 0.00 3.34 54.243.216.72 domainname GET /home/showprofile.php?v=434787044&target=d193ea5db7d19eda5e
    3-0 - 0/0/414 . 17.73 388 80 0.0 0.00 3.70 54.243.216.72 domainname GET /home/home.php?uname=coolstone&target=1f26d050353f9ad6ef386
    3-0 - 0/0/413 . 17.72 388 0 0.0 0.00 3.49 54.243.216.72 domainname GET /Register/user-img/q-male-2.gif HTTP/1.0
    3-0 - 0/0/375 . 17.75 388 5 0.0 0.00 2.67 54.243.216.72 domainname GET /home/chatchat/onlinecount1.php?inactivity=abhishek12093&_=
    3-0 - 0/0/413 . 17.73 388 0 0.0 0.00 2.64 54.243.216.72 domainname GET /Register/user-img/thumbnail_1355941572434893862.jpg HTTP/1
    3-0 - 0/0/400 . 17.73 388 2 0.0 0.00 3.39 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    3-0 - 0/0/391 . 17.71 388 0 0.0 0.00 3.59 54.243.216.72 domainname GET /home/images/scroll_articals.gif HTTP/1.0
    3-0 - 0/0/419 . 17.73 388 2 0.0 0.00 3.29 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    3-0 - 0/0/394 . 17.73 388 2 0.0 0.00 3.47 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    3-0 - 0/0/410 . 17.75 388 4 0.0 0.00 3.05 54.243.216.72 domainname GET /home/chatchat/chat.php?action=startchatsession&_=135693671
    3-0 - 0/0/389 . 17.73 388 23 0.0 0.00 3.99 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    3-0 - 0/0/412 . 17.73 388 7 0.0 0.00 3.37 54.243.216.72 domainname GET /home/showprofile.php?v=434787044&target=d193ea5db7d19eda5e
    4-0 - 0/0/1 . 0.02 749 35 0.0 0.00 0.00 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    4-0 - 0/0/1 . 0.02 749 3 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/onlinecount1.php?inactivity=unmoved&_=135693
    4-0 - 0/0/1 . 0.04 749 1014 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/chat.php?action=startchatsession&_=135693634
    4-0 - 0/0/1 . 0.02 749 2 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/onlinecount1.php?inactivity=pdp2312&_=135693
    4-0 - 0/0/1 . 0.01 749 12 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    4-0 - 0/0/1 . 0.01 749 6 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/onlinecount1.php?inactivity=ssvnov&_=1356936
    4-0 - 0/0/1 . 0.00 749 1 0.0 0.00 0.06 54.243.216.72 domainname GET /Register/user-img/resize_1355901400434861356.jpg HTTP/1.0
    4-0 - 0/0/1 . 0.02 749 1 0.0 0.00 0.00 54.243.216.72 domainname GET /scripts/sNotify.js HTTP/1.0
    4-0 - 0/0/1 . 0.01 749 1009 0.0 0.00 0.00 54.243.216.72 domainname POST /home/getcount.php HTTP/1.0
    4-0 - 0/0/1 . 0.00 749 10 0.0 0.00 0.00 54.243.216.72 domainname POST /home/chatchat/send.php HTTP/1.0
    4-0 - 0/0/1 . 0.00 749 6 0.0 0.00 0.01 54.243.216.72 domainname GET /home/chatchat/js/chatv8.js HTTP/1.0
    4-0 - 0/0/1 . 0.03 749 3 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/chat.php?action=startchatsession1&nick=shaar
    4-0 - 0/0/1 . 0.04 749 185 0.0 0.00 0.01 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    4-0 - 0/0/1 . 0.02 749 0 0.0 0.00 0.02 54.243.216.72 domainname GET /home/images/scroll_articals.gif HTTP/1.0
    4-0 - 0/0/1 . 0.04 749 1007 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/chat.php?action=startchatsession&_=135693628
    4-0 - 0/0/1 . 0.00 749 1 0.0 0.00 0.00 54.243.216.72 domainname GET /home/chatchat/css/chat.css HTTP/1.0
    4-0 - 0/0/1 . 0.00 749 0 0.0 0.00 0.01 54.243.216.72 domainname GET /Register/user-img/resize_1347342387.jpg HTTP/1.0
    4-0 - 0/0/1 . 0.00 749 0 0.0 0.00 0.00 54.243.216.72 domainname GET /favicon.ico HTTP/1.0
    4-0 - 0/0/1 . 0.02 749 527 0.0 0.00 0.01 54.243.216.72 domainname POST /home/usersload.php HTTP/1.0
    4-0 - 0/0/1 . 0.00 749 0 0.0 0.00 0.02 54.243.216.72 domainname GET /home/images/scroll_articals.gif HTTP/1.0
    4-0 - 0/0/1 . 0.02 749 1057 0.0 0.00 0.01 54.243.216.72 domainname POST /home/users.php?users=chat&target=45fe5eff7144e87882639730
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    13
    Rep Power
    0
    Apache Status (Part 2):

    Srv Child Server number - generation
    PID OS process ID
    Acc Number of accesses this connection / this child / this slot
    M Mode of operation
    CPU CPU usage, number of seconds
    SS Seconds since beginning of most recent request
    Req Milliseconds required to process most recent request
    Conn Kilobytes transferred this connection
    Child Megabytes transferred this child
    Slot Total megabytes transferred this slot
    mod_fcgid status:

    Total FastCGI processes: 12
    Process: php5 (/usr/lib/cgi-bin/php5)
    Pid Active Idle Accesses State
    11040 744 70 14 Ready
    Process: php-fcgi-starter (/var/www/php-fcgi-scripts/qauser/php-fcgi-starter)
    Pid Active Idle Accesses State
    11439 625 266 2 Ready
    Process: php-fcgi-starter (/var/www/php-fcgi-scripts/qauser/php-fcgi-starter)
    Pid Active Idle Accesses State
    11399 654 315 10 Ready
    Process: php-fcgi-starter (/var/www/php-fcgi-scripts/qauser/php-fcgi-starter)
    Pid Active Idle Accesses State
    11024 752 0 1434 Ready
    11618 542 0 875 Ready
    12653 244 4 469 Ready
    11004 752 4 1625 Ready
    11047 739 18 1289 Ready
    11048 739 22 1765 Ready
    10993 753 21 1510 Ready
    11005 752 0 1899 Working
    11617 542 0 1059 Working
    Active and Idle are time active and time since last request, in seconds.
    SSL/TLS Session Cache Status:
    cache type: SHMCB, shared memory: 512000 bytes, current sessions: 0
    subcaches: 32, indexes per subcache: 133
    index usage: 0%, cache usage: 0%
    total sessions stored since starting: 0
    total sessions expired since starting: 0
    total (pre-expiry) sessions scrolled out of the cache: 0
    total retrieves since starting: 0 hit, 0 miss
    total removes since starting: 0 hit, 0 miss
  18. #10
  19. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    Is that under load? You have plenty of open slots; I wouldn't expect that under load.

    Is /Register/user-img/resize_1285480599.jpg an already resized static image file or is that being rewritten to a dynamic image resizer? If it's the latter, you should consider caching that or doing the resize once and calling a static file instead.

    This shows a lot of the same or very similar scripts being called, so you should start with those. Obviously there's your chat script, which is likely the problem, but I'd look at its onlinecount1.php script, too, to see if it could be cleaned up. And usersload.php.

    It's difficult to optimize for a PHP-based chat script. There are some basic, always do this on your site things, but I'm sure you've Googled and implemented what you could from those.

    Have you used Firebug to profile your pages and requests to see how long each step is taking?
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    13
    Rep Power
    0
    Originally Posted by jharnois
    Is that under load? You have plenty of open slots; I wouldn't expect that under load.

    Is /Register/user-img/resize_1285480599.jpg an already resized static image file or is that being rewritten to a dynamic image resizer? If it's the latter, you should consider caching that or doing the resize once and calling a static file instead.

    This shows a lot of the same or very similar scripts being called, so you should start with those. Obviously there's your chat script, which is likely the problem, but I'd look at its onlinecount1.php script, too, to see if it could be cleaned up. And usersload.php.

    It's difficult to optimize for a PHP-based chat script. There are some basic, always do this on your site things, but I'm sure you've Googled and implemented what you could from those.

    Have you used Firebug to profile your pages and requests to see how long each step is taking?
    Yes. This report was generated under load.

    The /Register/user-img/resize_1285480599.jpg image is just the name of the image. The image could be 400 px x 300 px and when the PHP / HTML page calls is, the image is resized into a 117 px x 147 px box. So, the file is already cached in the browser after the first call.

    I will certainly look into the onlinecount1.php & usersload.php. These are some troublesome scripts.

    The page loading seems to be fine since most of the images / css / js get cached. The issue seems to be with php files.

IMN logo majestic logo threadwatch logo seochat tools logo