Wednesday, 17 April 2013
The upside down performance day
Some days turned to be more surprising than is should be. We had our sprint closing day and found a free hour to play with the project. I wanted to see if I could make the site faster by some helper module. I could not, actually.
Fist I did a clear analysis. Fired up JMeter, created a thread group for a massive HTTP request cycle using the admin user (via cookies) and loaded some pages in separate request pools, such as node add page, search page, search page with filters, messages page and front page. It wasn't very promising as expected. From 1 to 1.8 seconds. Well, no Varnish, no hardcore cache and admin user. That adds up for sure.
Then I added the fast_404 module. We had some broken images and hopes. First I had to realize the install hook was in Drupal 6 syntax, ehm. Anyways, fixed it and ran the test. I'm afraid it doesn't do the complete functionality as JMeter not loading all the resources, such as images - no improvement, in fact it was ~0.1 second slower in average.
Then I installed Memcached with the help of this very useful snippet. I downloaded the Drupal module, did the necessary settings, checked the service through telnet and also the Drupal status page - all set up and working properly. I run the tests again and it was even slower than the previous run. Now I'm really concern about reality and started loosing my faith.
Just for the clarity - for each trial I only enabled one new feature, so technically they don't affect on each other in these tests.
Then I thought I call an old fellow, Entity cache. Even worse. Plus ~0.2 seconds.
An interesting observation that Apache tend to get full during these tests. It reports memory allocation problems all over the site, so I have to restart it after each test.
Lesson learned after this, if you don't have proper time to setup your performance improvements and really configure it then better not to start. And I guess if I turn APC off and install a thousand of modules it's gonna be blazingly fast. *oh irony*
However it's great to see all these stats. JMeter can be pretty useful in these cases.