The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I benchmark / performance tune the web server?

Discussion in 'cPanel Developers' started by Simsen, Aug 23, 2007.

  1. Simsen

    Simsen Active Member

    Joined:
    Apr 13, 2007
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Hi all!

    I would very much like to make my web pages load faster, more specifically AJAX requests, but a general tune-up is most welcome too. The problem is I don't even know where to begin. How do I benchmark to identify the bottleneck?

    The reason I am posting is that it takes 4 seconds for very simple AJAX requests to yield a response, and that's with the string "hello" as the only data and NO database calls!

    So, where do I begin to find the culprit of these miserable response times?

    My system:
    • WHM 11.2.0 cPanel 11.10.0-C16448
    • CENTOS Enterprise 4.4 i686 - WHM X v3.1.0
    • Apache/1.3.37 (Unix) PHP/5.2.1 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a

    Thank you very much in advance.

    - S
     
  2. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    This is a very broad range question. I would suggest monitoring system performance for starters and get an sense of the full picture. Perhaps other things may be running or other trouble that you may not know about.

    in ssh

    top -cd1

    watch the loading, wait time, ram and swap usage, open processes etc.

    Paste your output.
     
  3. Simsen

    Simsen Active Member

    Joined:
    Apr 13, 2007
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    top -cd1 output

    I know it's a broad question, and I don't expect to be guided thoroughly in all aspects of this, but I am such an illiterate in server management that I didn't know about the command you just posted, "top cd1".

    So thank you very much, jayh38, your input is highly appreciated.

    Here is the output of "top -cd1":
    Code:
    top - 14:26:31 up 127 days, 18:29,  1 user,  load average: 0.00, 0.00, 0.00
    Tasks: 108 total,   1 running, 106 sleeping,   0 stopped,   1 zombie
    Cpu(s):  0.0% us,  0.0% sy,  0.0% ni, 100.0% id,  0.0% wa,  0.0% hi,  0.0% si
    Mem:   1033520k total,   923100k used,   110420k free,   167672k buffers
    Swap:  2031608k total,        0k used,  2031608k free,   450608k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    13436 root      16   0  2416  980  768 R    2  0.1   0:00.44 top -cd1
        1 root      16   0  2180  512  436 S    0  0.0   0:10.71 init [3]
        2 root      RT   0     0    0    0 S    0  0.0   0:08.74 [migration/0]
        3 root      34  19     0    0    0 S    0  0.0   0:01.81 [ksoftirqd/0]
        4 root      RT   0     0    0    0 S    0  0.0   0:09.30 [migration/1]
        5 root      34  19     0    0    0 S    0  0.0   0:04.25 [ksoftirqd/1]
        6 root       5 -10     0    0    0 S    0  0.0   0:41.02 [events/0]
        7 root       5 -10     0    0    0 S    0  0.0   0:28.36 [events/1]
        8 root       5 -10     0    0    0 S    0  0.0   0:00.00 [khelper]
        9 root      15 -10     0    0    0 S    0  0.0   0:00.00 [kacpid]
       36 root       5 -10     0    0    0 S    0  0.0   3:30.57 [kblockd/0]
       37 root       5 -10     0    0    0 S    0  0.0   5:07.45 [kblockd/1]
       58 root      11 -10     0    0    0 S    0  0.0   0:00.00 [aio/0]
       59 root      11 -10     0    0    0 S    0  0.0   0:00.00 [aio/1]
       38 root      15   0     0    0    0 S    0  0.0   0:00.00 [khubd]
       57 root      15   0     0    0    0 S    0  0.0   0:18.52 [kswapd0]
      203 root      25   0     0    0    0 S    0  0.0   0:00.00 [kseriod]
      317 root       8 -10     0    0    0 S    0  0.0   0:00.00 [ata/0]
      318 root       8 -10     0    0    0 S    0  0.0   0:00.00 [ata/1]
      336 root      12 -10     0    0    0 S    0  0.0   0:00.00 [kmirrord]
      348 root      16   0     0    0    0 S    0  0.0  97:31.24 [kjournald]
     1391 root       6 -10  3160  468  380 S    0  0.0   0:00.01 udevd
     1706 root       6 -10     0    0    0 S    0  0.0   0:00.00 [kauditd]
     1769 root      16   0     0    0    0 S    0  0.0   0:03.86 [kjournald]
     1838 root       0 -20     0    0    0 S    0  0.0   0:13.14 [loop0]
     1839 root      16   0     0    0    0 S    0  0.0   0:06.97 [kjournald]
     2599 root      16   0  3340  544  456 S    0  0.1   0:29.80 syslogd -m 0
    
    That output is quite an enigma for me, but I can probably google for the meanings of these values. It does seem to me, though, that the server hardly as any load at all, so I guess that's good.
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    The system looks fine, no load issues, low tasks and no swap. Of course you may want to monitor top and server logs while trying to load your pages at the same time.
     
  5. Simsen

    Simsen Active Member

    Joined:
    Apr 13, 2007
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Thanks again.

    I just found out that the AJAX requests are lightning fast on all other machines. Which is strange because the machine I am using is lighting fast and always kept up to date.

    But the question still remains; how do I benchmark and tune up a web server for maximum performance?

    So if anyone out there has some expert pointers I would be grateful to know.

    Thanks again.

    - S
     

Share This Page