Cherokee Web Server To The Rescue!
When TechMiso first launched the site was operating on a special Joyent Accelerator with minimal specifications. The site quickly outgrew the nominal features set so we migrated to a 256 slice at SliceHost, one of the best virtual service providers today. Although a superior provider, we immediately started experiencing problems with Apache due to it eating more RAM than available. Cherokee web server came to the rescue and solved all our problems, world peace to follow.
I first want to take the time to thanks the few folks who responded to my cries for help. Oli offered a lot of good information and ultimately provided the advice we ended up following: forego Apache in place of the lean mean web serving machine known as Cherokee.
It would have been easy to simply upgrade from the 256 to 512 slice to solve our problems. But since TechMiso is run by geeks, why take the easy way out? More importantly, why bother to spend more money than necessary? There is absolutely no reason why TechMiso cannot properly function on 256MB of RAM.
After tweaking Apache until I was blue in the face I was ready to give up. Nothing I did was working, even though I followed just about every piece of advice offered on the Internet. Not only did I tweak Apache, but I also tweaked MySQL and other services running on our box. Make as much RAM available to Apache so it would stop consuming more resources than available.
But alas it was not meant to be. Cherokee web server to the rescue. Cherokee bills itself as the following:
Cherokee is a high-performance web server. It is very fast, flexible and easy to configure. In fact, it is the fastest web server there is. Check out the benchmarks and see for yourself. It offers support for the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, SSI, TLS and SSL encrypted connections, Virtual hosts, Authentication, on the fly encoding, Load Balancing, Apache compatible log files, Data Base Balancer, downtime-free updates and upgrades, Reverse HTTP Proxy, and much more.
It is highly efficient, extremely lightweight and provides rock solid stability.
Cherokee is definitely, without a doubt efficient and extremely lightweight. Since migrating from Apache to Cherokee about 36 hours ago TechMiso has no longer experienced lockups. This is important for two reasons: the site remains up without issue and there is no longer a need to hard reboot the server once all the available RAM is consumed.
There are a few important differences in memory usage I have immediately noticed since our migration to Cherokee.
- The amount of available RAM has increased dramatically. Cherokee uses a minimal amount of memory and rarely exceeds more then a negligible few megs. Contrast that to Apache consuming RAM like it grows on trees.
- The use of swap has become almost non-existent. Since Cherokee is so lightweight it does not need to force the OS to start using swap space in place of physical RAM. This has the dual effect of ensuring the site stays speedy while resource consumption remains low. Most important – the site no longer locks up and becomes inaccessible due to the constant swap use.
The one caveat to using Cherokee is that since it is not Apache it will not work with mod_php. Instead it must use fastcgi, which essentially executes PHP on the command-line in the background. In most tests fastcgi has been slower than mod_php in parsing PHP. But for sites not doing anything fancy, like TechMiso, the speed difference is unnoticeable.
Outside of Cherokee being a wickedly speedy, lean and lightweight web server, the best part is the manner in which it can be administered. Cherokee offers two options for its configuration – modify easy to understand text files similar to how Apache is configured. Or use the user-friendly cherokee-admin interface.
Cherokee-admin is capable of configuring just about every aspect of Cherokee but from a sexy web-based interface. If you are afraid of text files, or like us – new to Cherokee – then this is a lifesaver. Like the server itself, the admin GUI is lean, lightweight and very simple, hiding a boatload of power behind its sexy interface.
Installing Cherokee was just as easy as installing any other Ubuntu package. I plan to write-up a quick HOWTO sometime this week for those interested in taking the same plunge TechMiso took. It is well worth it!
Cherokee literally rescued TechMiso from some hard times. A free download, Cherokee ended up saving us money in the longrun. Rather than having to upgrade our 256 slice to a 512 slice, Cherokee rescued our resource consumption and saved us $18/mo since we did not need to upgrade the slice. Not bad for a free product, right?
If you ever get the opportunity, I strongly encourage you to look over Cherokee. It does exactly what it is designed to do and does it very well. Regardless of the savings it offered TechMiso, the project is one of those lil gems in the internet sea. Give it a shot and you may find that it ends up rescuing you one day too.