html, perl and mysql
Thanks!
1 Reply
@cap:
I'm preparing a site that uses mod_perl and mysql to generate both static and dynamic pages. Is there an advantage in using separate nodes, one for serving the html, one for the dynamic content, and one for running mysql? If so, any suggestions on the best configuration?
Thanks!
This seems to be one of those "skinning a cat" questions, in the end… "it depends."
It can even come down to your specific app as to the best way to do things… The basics aren't so bad though.
I tend to try to balance high-memory but "easy" tasks like caching with things that are using a lot of CPU but don't need much RAM (Front-end/static servers, load balancers, etc.) to make sure those machines are getting well-utilized.
Then the other end, I usually just push to get everything off the database boxes that I possibly can, to allow them some hope of attempting to catch up with the rest of the system.
The initial steps of dividing up a typical LAMP setup are often quite generic, at least…
* Single box
Single box - Larger
2 servers - Smaller frontend with heavy db behind
3 servers - Smaller front+cache, moderate app server between, big db behind</list>
That's about it for "normal" though.
After that it's pretty much totally down to your individual app, the environment it's running under, and the weather on the day, it often seems? When you're deciding which way to go next.
How close are you to bottoming out with your current config?
For modperl and MySQL doing mixed static/dynamic, I'd seriously think about an nginx front, use it to serve the static files and proxy to modperl, it'd probably offer a bigger performance increase in most cases and you'll free up some resources.
Bonus: it will also be able to continue with minimal changes, to serve as a proxy, SSL device, whatever, if you decide to add more app servers next.
Just be sure to keep the workload of each server in mind as you divide the duties between nodes, and keep in mind that (as far as I've seen) Linode seems to have brilliant CPU compared to most VPS hosts.
Splitting can be great alone but at the end of the day a good balance of work on each box is far more important than number or size of them.
I was once asked to help with a 2GB slice that was really struggling… they got a huge improvement when it was switched to a 512MB, just because we threw a 256MB running nginx and a tiny memcache in front of it!
This is truly my favourite thing about VPS hosting, it just needs a lot of practice and a little luck to find the right balance each time.
__[ Edit: Sorry for the long-dead thread revive!
I figured I should start being friendly in the forums since I'm hosting here now and inevitably going to need help at some point…
So I just went to threads on the front page without replies and tried to help without looking too closely,__ then __noticed the time on it… This place really is a ghost town!
I guess at least search result hits will have some attempt at an answer to show now.