fredag 29 maj 2009

Benchmarking my DSL server with win ab.exe

I decided it was time to find out where the bottlenecks on my server is. I have linux on my server, and WinXP on my workstation. Luckily, apache has a great tool for benchmarking on both versions, called ab (apache benchmark). On the windows version, it's a standalone file called ab.exe, which can be run from cmd.

Server speccs:
  • 2.6Ghz intel Celeron
  • 256Mb RAM
  • 5400RPM hdd

    Server software:
  • Damn Small Linux 4.4.10 (Linux kernel 2.4.31)
  • Apache 2.2.9
  • PHP 5.2.6
  • MySQL 5.0.67

    Test 1:
    I decided to use a page with only phpinfo() on, in order to exagurate the amount of output the server would generate / page request. With other words, no DB-interaction.

    CLI vs. GUI:


    ab.exe -n 100 /phpinfo.php (CLI, rebooted)

    Time taken for tests: 12.078 seconds
    Complete requests: 100
    Requests per second: 8.28 [#/sec] (mean)
    Time per request: 120.781 [ms] (mean)
    Transfer rate: 476.58 [Kbytes/sec] received


    ab.exe -n 100 /phpinfo.php (GUI, also rebooted)

    Time taken for tests: 9.031 seconds
    Complete requests: 100
    Requests per second: 11.07 [#/sec] (mean)
    Time per request: 90.313 [ms] (mean)
    Transfer rate: 637.36 [Kbytes/sec] received


    I don't know if it's fluke or what, but +25% performance in (logged in) GUI compared to (at login promt) CLI really seems odd. I did the test trice with almost identical results.

    The rest of the tests are done in GUI, mainly for the ability to see the system load in realtime. Now, lets find the bottleneck.


    ab.exe -c 10 -n 1000 /phpinfo.php # Simulating 10 users, 1k requests.

    Time taken for tests: 86.063 seconds
    Complete requests: 1000
    Requests per second: 11.62 [#/sec] (mean)
    Time per request: 86.063 [ms] (mean, across all concurrent requests)
    Transfer rate: 668.83 [Kbytes/sec] received


    While monitoring the system load, CPU usage was around 10%, RAM usage was low, and network was nowhere near the cap of the bandwidth available. My guess is that it's the slow 5400 RPM harddrive that slows down the tests. But lets cramp up the numbers.


    ab.exe -c 50 -n 1000 /phpinfo.php # Simulating 50 users, 1k requests.

    Time taken for tests: 143.531 seconds
    Complete requests: 1000
    Requests per second: 6.97 [#/sec] (mean)
    Time per request: 143.531 [ms] (mean, across all concurrent requests)
    Transfer rate: 401.03 [Kbytes/sec] received


    CPU at 13-16%, RAM usage went up about 10Mb's, and network activity was still low. With a higher accesstime, my initial assumption of the slow harddrive seems correct, with more simultaneous tasks, it can't keep it up. I can continue to up the concurrent users, but we'll just see a higher Time per request, and lower Requests per second. I'm glad so far, however. Before I started testing I assumed the 256Mb RAM would be a problem. The 2.6Ghz celeron was abit of a wild card for me. While still very fast for a single-core CPU, celeron can't compete with any other type of CPU with the same frequency, especially at multi-tasking.

    When it's time, I'll benchmark the database performance. But for now, I'm happy with the results.
  • Inga kommentarer:

    Skicka en kommentar