Joyent

Joyent Weblog

Can you check my math? (Perhaps we'll also call this, "What's in a web server"?)

A quick comment and something to point out after some comparisons of Apache 2.0-prefork versus Lighttpd and Litespeed for running Rails applications.

Paul Q. in the debunking lighttpd post he wrote a while back, had as his main point that benchmarking a web server using localhost tells you nothing about and ignores the ability of a web server (and the underlying OS) to saturate it’s network connection.

So in the benchmarks over at weblog.textdrive.com, they were all pumping out about 1000 requests/second over a gigabit connection, and now to put that in some context.

The page was our main and initial page at textdrive.com, it’s 140KB uncompressed and because most of that is images, it comes out compressed at 122 KB and has 20 objects that are being requested per page visit.

Let’s for argument’s sake say it’s 125KB.

Why?

A 100Mbps connection has a theoretical maximum of 12.5 MB/sec and a 1000Mbps has a theoretical maximum of 125 MB/sec, and I’d like to make the math easy.

So for a 125KB page, you can do 100-1000 unique visitors per second and with 20 objects per page, that is 2000-20,000 requests per second that could pump out of that system.

Maximum.

And this is assuming you have all your ducks in a row and your system can flood a 100Mbps or 1000 Mbps connection.

What is the ability to do 1000 requests/second then?

For the 125KB page that’s composed of 20 things, it means ((1000 requests/sec)*(20 requests per page)) * 0.125MB per page = 6.25 MB/sec

Or 50Mbps constant.

That’s actually a lot. There’s 122,400 seconds in a day and to do that constantly (1000 requests/second) would be 12,240,000 uniques in a day with 244,800,000 hits.

Granted this is just “web” and a simple page pulled by simple rails from a simple database.

This is somewhat related to this, this and that


  1. Hm, so if I want to pump out a fairly simple Rails app that could support 1000+ people at a time, a T2000 would be a good choice?

    — Joe    948 days ago    #
  2. Yikes , apparently the T2000 is expensive. :-)

    — Joe    948 days ago    #
  3. Craigslist does 110 MILLLION page views a day. They do it with apache, mod_perl, lots of caching, and a crazy system. But they only have 4 programmer / sysadmins working on the site.

    rabble    947 days ago    #
  4. 100Mbps divided by 8 bits = *12.5*MBps

    /pedantic

    Paul    946 days ago    #
  5. I think there are only 86,400 seconds in a day.

    /re-pedantic

    — Brett    942 days ago    #
  6. Oh yeah, 86,400. Where did 122400 come from.

    Jason Hoffman    942 days ago    #
  7. Rabble,

    Craigslist serves the majority of their pages as static pages. With no external CSS pages. And images on separate image servers.

    SuperJared    932 days ago    #
  8. The numbers from your FreeBSD netperf tests seem to be really, really bad. So bad that I’d say you have something either very wrong or these numbers are completely bogus. I’ve run the same tests on older hardware with 100Mbit cards and found results that were more than twice as fast:

    http://joseph.randomnetworks.com/archives/2006/05/05/joyenttextdrives-really-really-really-bad-netperf-benchmarks/

    Looks like the format of your page breaks long URLs (at least in the preview), so here is wrapped:

    http://joseph.randomnetworks.com/archives/2006/05/05
    /joyenttextdrives-really-really-really-bad-netperf-benchmarks/

    Joseph Scott    930 days ago    #
  9. Which FreeBSD?

    Jason Hoffman    929 days ago    #

Commenting is closed for this article.