Slashdot My Linode

From LinodeWiki

Jump to: navigation, search

You likely purchased your Linode because you thought, "Hey this ish looks cool, it's cheap, I get to pick my flava linux, and I get to be r00t. Now I can host my blog, my forums, and show everyone my rawking pics." Everything was going along peachy, a few friends visited your site and it was fast and everyone's all happy. Then one day--the trial by fire day--your site becomes popular and everyone wants to visit, will your site survive?

Contents

[edit] Choosing the right AMP in LAMP for your Linode

While everyone loves LAMP (Linux Apache MySQL PHP) there are somethings you need to keep on your mind when it comes to the AMP of your Linode.

[edit] A -- Apache, Is It Right For You?

Apache--the defacto standard for serving up web requests--is equipped to tackle any size website you can throw at it. Also you get the added comfort of being able to pick your favorite medium to find support for usage and configuration. But is it right for the sites hosted on your Linode? The short answer is, it can be. It is just a matter of learning how to tune it, for instance knowing the appropriate sizes for directives like the Min and Max clients/threads/servers, the basics are found at Apache's httpd site.

However, you should also be aware that there are plenty of other httpd servers designed for small footprint (low memory usage) that are readily available, well suited to the task, and easily configurable. A small incomplete list would be:

[edit] M -- (My)SQL the IO Hog

A large percentage of the website packages you want to run on your Linode have a MySQL or other database backend. Yet, the nature of the beast is you'll use lots of IO making lots of queries, or if you try and push everything into memory you'll start thrashing swap (and therefore eat your IO) because you don't have that much memory. So, can you run a MySQL server on your Linode? Again, the short answer is yes, you can. And again, the subanswer is it's also about knowing how to configure MySQL to your low memory setup. Here is a sample configuration

Another possibility is to take advantage of a MySQL service that is located on another server, or Linode for that matter. For instance, there is a Value Added Service for Linode in the works, and right now the beta is free. The advantage to this is you get dynamic data without eating all the IO on your Linode.

See also: Cached (Static) Content vs Dynamic

[edit] P -- PHP Tunage

To Be Added: For now google for tune php memory usage.

If you are using lighttpd or another FastCGI interface to PHP you may want to limit the number of php processes spawned, the same way you would limit the Min and Max clients/servers/threads for Apache

Turck MMcache is very useful; I use it extensively on my Linode. –Martinultima 14:46, 9 Jun 2006 (EDT)

If you want an updated and under-development solution, I would recommend eAccelerator. OverlordQ 02:40, 30 Jun 2006 (EDT)

[edit] CachedVsDynamic

This applies to pretty much any web application you would want to serve up (for instance a blog or a CMS) on your IO limited Linode. One of the best ways to ensure your Linode will stay alive during high traffic is to utilize some sort of cache feature for the application. This means you are serving up static content versus dynamically generating it from a database backend. The former has a significantly less amount of IO calls versus the latter which may have difficult or multiple SQL queries and lots of IO overhead. I have found cache plugins (sometimes called static plugins) for Mambo, TikiWiki, and WordPress (for example).

If you are unable to find a cache/static plugin for your particular application there are a couple of methods you could try to stem the tide of IO calls. One method would be to use Squid in Httpd Accelerator Mode. Another way would be to manually create a static version of your site when something changes. This would essentially mean going to each page and grabbing the html and serving it instead of the dynamic content. (still looking for an example tool)

Personal tools