Tonight I found out just how important Drupal’s Page Caching feature is!? With no concrete answers on the internet for “sizing” drupal to a server. Or how well it scales.. I would recommend running a test yourself to see how well it performs. Be forewarned tho, you may need permission to run this against public internet servers that your website runs on. Check with your Administrator’s first.
Test server; AMD Phenom(tm) 8650 Triple-Core Processor (2.3GHz) -> running Debian 5 in 32 bit mode. Apache2, MySql 5, 4GB ram. Drupal 6. Each core has speed stepping on. Idle running at 1.2 Ghz. The tests were performed remotely by JMeter running on iMac.
MySQL has had little to no optimizations done to it out of the box (apt-get).
35 user test, viewing 5 pages, 10 loops. Drupal Page Cache Disabled. With block cache enabled, Optimize CSS files enabled, Optimize JavaScript files enabled.
Samples = 1750, Deviation = 574, throughput = 1039.069 a minute, average response 1966ms, median response ms = 1979ms. Top says the load hit 27 instant load.
Same testing, with all caching enabled (basically just re-enabled page cache);
Samples = 1750, Deviation = 394, throughput = 11,892.280 a minute, average response 123ms, median response ms = 59ms. Top says the load hit 1.94 instant load.
Below here deals primarily with page cache disabled state;
You need to remember, if my CPU is 3 core, and my Load hits 3. This means (theoretically) full utilization. 100%. A load of 27, means I need 24 more cores to keep up. Obviously a little misleading.. I can still type in the terminal window, and the server is responsive there giving me proc info etc.
I come up with a 97% deficiency without page caching alone. The proof is in the average response time of nearly 2 seconds.
Double checking CPU Speed Stepping; The CPU cores all Step up to 2300.00 Mhz automatically like they should during the test. “cat /proc/cpuinfo | grep MHz”
MySQL status; Threads: 1 Questions: 407233 Slow queries: 0 Opens: 2775 Flush tables: 1 Open tables: 64 Queries per second avg: 0.392
phpmyadmin runtime info; Created_tmp_disk_tables = 48.. Hmmm. So some misconfiguration exists out of the box for mysql too..
My max conncurrent connections is set to 35.. This may cause an issue with this test.. I’ll bump it up… While running the test, I watch my Disk Wait State. It stays at 0.0% or 0.1% at the end of the test. When I changed my.cnf to have 100 and restarted mysql. I only noticed it increase to 60 concurrent connections, when I increased the users to 100.
100 user test, page cache enabled;
Samples = 5000, Deviation = 602, throughput = 12,271.444 a minute, average response 430ms, median response 282ms. Top says the load hit 6.21 instant load.
One more note here. I see Idle time dip to 5%.
100 users * 5 webpage views * 10 loops = 5000 webpage views in 25.3 seconds. Essentially 197 cached webpages served per second.
100 user test, page cache disabled;
idle dipped to 0.0% here. no wait time for disk. instant load average top 94.60
100 users * 5 webpage views * 10 loops = 5000 webpage views in 290 seconds. Essentially 17 uncached webpages served per second.
I will try the php xcache stuff later. It seems some WWW providers have this available. We have it too, so Will test it out to see the performance increase.
Day2 (about 5 hours later, couldn’t sleep anymore); I installed php5-xcache in Debian. Restarted Apache and ran another test;
no wait time for disk. instant load average top 14.60
100 users * 5 webpage views * 10 loops = 5000 webpage views in 100 seconds. That is a huge improvement; 50 uncached webpages served per second using xcache.
To recap; Apache2 + Drupal6 + Mysql6 + PHP (LAMP) on this server in particular, performs well enough. It can service 197 users per second average without breaking a sweat so long as most those pages are cached by Drupal. If you turn off page caching, you will see 1/10th or less of the performance, and only 17 users, having a very tough time, will be able to see your website. Most of them waiting up to 2 seconds or longer to see a response from your server for the first page request (not including graphical content)