the authors of drupal have paid considerable attention to performance and scalability. consequently even a default install running on modest hardware can easily handle the demands of a small website. my four year old pc in my garage running a full lamp install, will happily serve up 50,000 page views in a day, providing solid end-user performance without breaking a sweat.
when the times comes for scalability. moving of of the garage
if you are lucky, eventually the time comes when you need to service more users than your system can handle. your initial steps should clearly focus on getting the most out of the built-in drupal optimization functionality, considering drupal performance modules, optimizing your php (including considering op-code caching) and working on database performance. John VanDyk and Matt Westgate have an excellent chapter on this subject in their new book, "pro drupal development"once these steps are exhausted, inevitability you'll start looking at your hardware and network deployment.
a well designed deployment will not only increase your scalability, but will also enhance your redundancy by removing single points of failure. implemented properly, an unmodified drupal install can run on this new deployment, blissfully unaware of the clustering, routing and caching going on behind the scenes.
incremental steps towards scalability
in this article, i outline a step-by-step process for incrementally scaling your deployment, from a simple single-node drupal install running all components of the system, all the way to a load balanced, multi node system with database level optimization and clustering.
since you almost certainly don't want to jump straight from your single node system to the mother of all redundant clustered systems in one step, i've broken this down into 5 incremental steps, each one building on the last. each step along the way is a perfectly viable deployment.
tasty recipes
i give full step-by-step recipes for each deployment, that with a decent working knowledge of linux, should allow you to get a working system up and running. my examples are for apache2, mysql5 and drupal5 on debian etch, but may still be useful for other versions / flavors.note that these aren't battle-hardened production configurations, but rather illustrative minimal configurations that you can take and iterate to serve your specific needs.
the 5 deployment configurations
the table below outlines the properties of each of the suggested configurations:step 0 | step 1 | step 2 | step 3 | step 4 | step 5 | |
---|---|---|---|---|---|---|
separate web and db | no | yes | yes | yes | yes | yes |
clustered web tier | no | no | yes | yes | yes | yes |
redundant load balancer | no | no | no | yes | yes | yes |
db optimization and segmentation | no | no | no | no | yes | yes |
clustered db | no | no | no | no | no | yes |
scalabilty | poor- | poor | fair | fair | good | great |
redundancy | poor- | poor- | fair | good | fair | great |
setup ease | great | good | good | fair | poor | poor- |
step 0 - a basic drupal install
step 1 - a dedicated data server
step 2 - sticky load balancing with apache mod_proxy
step 3 - using heartbeat to implement a redundant load balancer
step 4 - database segmentation using mysql proxy
in this article i discuss scaling the database tier up and out. i compare database optimization and different database clustering techniques. i go on to explore the idea of database segmentation as a possibility for moderate drupal scaling.
step 5 - the holy grail?
the holy grail of drupal database scaling might very well be a drupal deployment on mysql cluster. if you've tried this, plan to try this or have opinions on the feasibility of an ndb "port" of drupal, i'd love to hear it.
Reference: http://www.johnandcailin.com/blog/john/scaling-drupal-open-source-infrastructure-high-traffic-drupal-sites
No comments:
Post a Comment