| |||||||||||
| |||||||||||
Clustering, load balancing, mod_rewrite and mod_proxy
"It's not friendly - it's like a reference book". Customer comment on yesterday's tailored training day, where we were load balancing a web application between a number of back end servers, using Apache httpd, with mod_proxy and mod_rewrite to do the clever bits.
Our customers are right - it IS tough for a newcomer to work out what to do from the mod_rewrite manual. So you might like, for starters, to read my article on techniques for load balancing and clustering. Then you might like to look at some of the sample configuration files that we used to have a single httpd instance share the load between multiple further httpds, or multiple Tomcats. Yes, that's right, the solution works not only for Java applications, but also for Perl and PHP ones! For newcomers to balancing the load, via mod_rewrite and mod_proxy, here's a commented version of the additions we made to httpd.conf at the end of the day, to share PHP applications in a directory called /demo on our backend servers via a URL called /booze on our front end. The phpbal.conf file is as follows: local 192.168.200.67:80and that instructs the server to randomly choose between our live web server and one of the servers in our training centre for first service ... then to revert to the same server if the cookie is set with a "live" or "local" value. The full source of the PHP application we tested with is in one of the links above, but the vital line to set the cookie is worth reproducing here: setcookie("what","local-".$uniquekey);with "local" changed to "live" on the second system in the cluster ... I do enjoy days like yesterday, when we explored topics that are advanced and not quite the nor for our usual courses. My customer left really happy with what we had done, and I had the opportunity to push through and develop further practical knowledge and further my own understanding of some of the detail - a true win/win. And of course I'm all the better place not if YOU want to come and learn more about sharing the load across servers - whether you've a PHP or Java application. (written 2006-11-21 07:02:15) Associated topics are indexed under A900 - Web Application Deployment - Tomcat - Extra FeaturesA603 - Web Application Deployment - Further httpd Configuration H114 - Sourcing, installing and configuring PHP
Some other Articles
Bratton and Edington new town, WiltshireDisplay an image from a MySQL database in a web page via PHP Global, Superglobal, Session variables - scope and persistance in PHP Autumn leaves in Wiltshire - Potterne Clustering, load balancing, mod_rewrite and mod_proxy Course Joining package - updated A tale of a wee wall Before and After - Well House Manor -> , >= and => in Perl Presenting Melksham - for a weekend away in Wiltshire 1638 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||