Search Site
Topics
RSS Feed
« Thinking Out Loud About My Private Cloud | Main | Announcing: The Business Continuity Cloud »
Saturday
Apr042009

Drupal: Peformance and Scalability

Since I do work on Drupal sites from time to time and have built some very large ones I do keep an eye on the Drupal "stack" and change. But, I haven't revisted it for a while.

A few months ago I posted an article about a Drupal stack that I had tested w/ a big media company to do 2.5 billion page views a a month. It was a lot of servers and some sophisticated modifications to Drupal.

It's still a solid architecture but there are some new entries I thought I'd like to evaluate. I also deployed that one on Joyent so I was curious what I might be able to do with other cloud vendors. This time I picked Rackspace's Cloud Servers since they were kind enough to comp. nScaled, Inc. a little free time to test things out an demo to clients. So, I've been beating up on them pretty good. I'm impressed and considering what I did to some of their servers yesterday I'm surprised I didn't get a cease and desist!

Here is the Drupal Stack I built and configured.

Drupal Software Stack

So, once I got everything installed I load tested it using httperf 0.9.0. I was able to generate and server approximately 150 req/sec over the internet from another cloud providers servers in a different state. Now, I wasn't going for super scientific on my load testing there. Just a reasonable look at what it might be able to do. I also installed the APC statistics page. During the run, it looked like this:

APC Stats Page for Drupal Test

As you can see it was pumping out a little over 800 requests / second from the cache.

I configured AuthCache, which is a fork of the Drupal CacheRouter project to use memcached as it's data store. It was also pretty busy. The output from a little memcached status script I used showed the following.

Test:/src# ruby stats.rb
STAT pid 3823
STAT uptime 1238
STAT time 1238884956
STAT version 1.2.2
STAT pointer_size 64
STAT rusage_user 0.428026
STAT rusage_system 2.076129
STAT curr_items 30
STAT total_items 108
STAT bytes 198842
STAT curr_connections 151
STAT total_connections 152
STAT connection_structures 152
STAT cmd_get 135821
STAT cmd_set 129
STAT get_hits 135780
STAT get_misses 41
STAT evictions 0
STAT bytes_read 5123354
STAT bytes_written 313147950
STAT limit_maxbytes 67108864
STAT threads 1
END

Oh, I also used munin to keep track of what was going on at the machine level.  I can't show all that output here, but you can see that network traffic was certainly pumping with this graph.  That big spike there was when I was pushing the full rate.  I wasn't actually able to go beyond this level pretty much no matter what I threw at the system.

 

 Maybe that's a hard limit.  I'm not sure yet.  I really thought I would be able to get more out of the system.

It's worth mentioning that I also integrated varnish as a reverse proxy.  After going through a ton of different VCL files I might have found one that works a little bit. But, it turns out that Drupal is very unfriendly out of the box for reverse caches.  What this means in practical terms is that if you want to use a local reverse proxy like varnish, squid, or perlbal then you will need to do some hacking on Drupal to make it more cache friendly.  This also means that CDN services might have a difficult time working with Drupal without you modifying Drupal itself.  I really think this is an area ripe for improvement with Drupal 7.  Hopefully cachability is being addressed with that release.

This entire test was performed on a 2GB slice on Rackspace's Cloud Server.  I started with a 512 slice but it needed a bit more RAM to cram all that into it.

The level of performance I've got would translate to the ability to do a maximum of about 388 million page views a month assuming you didn't do a bunch of weird stuff to Drupal making is slower.  This would fit quite well as built in a 1G slice.  So, that would cost, in instance fees, $43.80 per month plus whatever bandwidth you happen to use.  I'd say that's quite a bargain.

TO DO:

 

  1. See if I can get it to work with Cloud Files somehow.  That would be sweet.  But, there is that nagging issues with having to hack up Drupal which comes with other problems.
  2. If I can't get it to work with Cloud Files, try to go hybrid and use the Drupal Cloud Front module that integrates with Amazon Cloud Front.  That could be interesting.
  3. Keep tweaking on the varnish VCL and see if I get something I like better.  Not really happy with it.
  4. Scale it and keep testing to see how far it can go this way.

 

I'm certain that by breaking the stack apart to more machines and a variety of other scaling tricks I could make this system scale quite well.  I might play with that a bit later when I have more time.  This was fun for a little weekend project though.

EmailEmail Article to Friend

Reader Comments (5)

We are looking at moving a few sites to Mosso Cloud Servers very soon. We have a handful of Drupal sites we'll be moving as well as some custom built sites. We are planning to do a little performance comparison including Amazon EC2 and standard hosted device. Assuming you used a stock instance of Drupal, I'd love to see some deeper detail on your test.

What was your httperf test plan? What URL(s) were you hitting at what rate, etc.

What, if any, tuning did you to to the various apps in the stack? Apache, PHP, Memcached, mysql?

Any additional information you can provide would be greatly helpful.

April 13, 2009 | Unregistered CommenterMichael Marnao

Hi Michael, thanks for the note. I'm sorry I haven't had time to dig deeper into this lately. Other work has kept me rather busy. However, I do work quite a bit w/ Rackspace's cloud services. I haven't tested this on Cloud Sites yet, but I intend to do so. I'll try to get a follow up post out sometime soon with the answers to your questions.

-Kent

April 17, 2009 | Unregistered CommenterKent

Kent,

frankly, for a Drupal stack you describe on a 2GB slice, 800 requests / second is highly unrealistic. A 2GB Drupal slice with reasonable functionality, content size and the configuration like what you are describing typically has something like 50-80 req/sec throughput. You would not be able to get performance 10x times more.

No offense, but something must be wrong with your test setup. If most of your requests were hitting Varnish - you were not really testing the performance and scalability of Drupal, now, were you? :)

April 19, 2009 | Unregistered CommenterIrakli

Hi @Irakli

I totally agree with you. Drupal in 2GB Cloud Server slice for this setup would most certainly NOT do 800 dynamically generated req/sec.

But, I didn't say it would. The number from my test is 150 req/sec. for this test.

If you are referring to my reference earlier in the document to the 2.5 billion per month build (which I peaked at 950 req/sec under load), it was a much larger production deployment than this test and on a different internet provider. It had sophisticated load balancing and used some hacks to split database queries amongst a master/slave(s) setup. I didn't do that here. My goal here was to get the most I possibly could out of a single slice since that's how most people like to run their application anyway.

My tests were for a complete production stack with Drupal to maximize potential output. Drupal out of the box without a a reverse proxy/CDN, internal caching modifications, opcode cache, and memcached in front of it's database. Out of the box/Without augmentation it won't get far in production for a large site for a number of reasons. I hope this article shows how to make it do much more in even a small and inexpensive setup. That was much the idea for writing it.

No offense taken! Thanks for the comments and reading my post. I'll take a look at th post and make sure it's clear that I did 150req/sec. If not, I'll post a follow up add on.

Cheers!
Kent

April 19, 2009 | Unregistered CommenterKent

Excellent description and that would be the same way, that I would go. Have you used standard-vcl from varnish? Or if you've modified default.vcl, have you checked the "authcache" cookie?
Could you provide your solution, beacuse I''ve some trouble to run varnish 1.1 with correct Cookie, GET/POST handling between drupal/varnish..

Thank you.

June 26, 2009 | Unregistered Commentertom
Member Account Required
You must have a member account on this website in order to post comments. Log in to your account to enable posting.