AnthonysBlog.Net
Anthony's Blog

Switching to Lighttpd for image hosting

As some of you know, running a image hosting site can be a bit of a headache in the field of performance/cost ratio. As 99% of the time we are just giving away our services and making pennies a day keeping the cost down but performance up is the challenge. I currently run FreeImageHostingOn.us a free image hosting site. The problem is the traffic these sites can generate.

For example, today I just moved to a new box, so lets look at this months stats.

The bandwidth for today before the move.

Now lets look at this weeks bandwidth.

Now some stats. Please keep in mind that on the busy days I have to suspend the site to stop it from overloading the server.

So today as I don’t want to close shop, but need to save some money I made some changes.
First I got another VPS just for this project. The VPS came from Ruby Ring Technologies I am using there VPS 1024 with GigE upgrade. However instead of CentOS with cPanel like before, I installed the LXAdmin option. At the time of this writing, which is now powering the image site, I am using all of 44MBs of ram. Check out Traffic Stats for more details.

What makes this such a great option is the very low memory usage and the Lighttpd WebServer that it installs by default.
Out of the box the VPS was screaming, however I new I could get some better performance out of it. By adding the following six lines to the lighttpd.conf file my memory usage almost dropped by 25% and my performance darn near doubled.

server.max-keep-alive-requests = 4
server.max-keep-alive-idle = 4
server.event-handler = “linux-sysepoll”
server.network-backend = “linux-sendfile”
server.max-fds = 8192
server.stat-cache-engine = “simple”

That was it, pretty darn simple.

Now this is just today’s performance, but I am hoping over the next few weeks to update this post with some more graphs and updates to see if it can deal with the load.

******** Update – July 22 ********

well it has been about 24 hours on the new VPS let’s see some stats.

First off Traffic:
40Mbit

Not bad seems we peaked out at 40Mbit, not bad at all.

Memory Usage:
130MB's

Ok so were looking at 130 MB’s of RAM Used, could be a little better but not complaining as I am pushing out 40Mbits of traffic.

CPU Usage:
CPU Usage

Yeah so that would be what 40Mhz, whoop dee doo.

Some awstats:
AWStats

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Reply

You must be logged in to post a comment.

Categories

 Powered by Max Banner Ads