high performance static file server in Luvit

213 views
Skip to first unread message

Jak Sprats

unread,
Mar 22, 2012, 12:03:04 PM3/22/12
to luvit
Hi Group,

I have experimented w/ creating very fast static webservers before,
and I think Luvit is a perfect fit for the next generation.

The trick to getting static webservers to go fast is to bypass the OS.
Caching any files that MAY be served in memory in RAM and also
gzipping them before they are served can yield that nice 50K TPS
number Tim got on his 3.4 GHz single core (depending of course on file
size {i.e. response size}).

Then an API has to be created to update files in the webserver's
cache. Anyone got any advice on how this API should look/work in
Luvit?

If a loadbalancer is in front of the static webserver, it is trivial
to taskset single webserver's to different cpu cores, have each
webserver listen on a different port and given the right NIC (and IRQ
settings) you can serve maybe 500K TPS per box. (NOTE: you need lots
of RAM, and the aggregate sum of the files you MAY serve has to be
smaller than said RAM -> but this is almost always the case).

I think a setup like this would showcase Luvit's strengths and could
be blogged about.

And then the really cool thing is, adding in dynamic logic (i.e.
control lists, or whatever) is already there, because this is a
dynamic webserver.

- jak

Vladimir Dronnikov

unread,
Mar 22, 2012, 12:56:10 PM3/22/12
to lu...@googlegroups.com
Hi!

Try tweaking my https://github.com/dvv/luvit-static

--Vladimir

Jak Sprats

unread,
Mar 23, 2012, 10:23:14 AM3/23/12
to luvit
Hi Vladimir,

looks pretty good, it has Etags, Chunks, etc...

thanks,
jak

On Mar 22, 1:56 pm, Vladimir Dronnikov <dronni...@gmail.com> wrote:
> Hi!
>
> Try tweaking myhttps://github.com/dvv/luvit-static

Vladimir Dronnikov

unread,
Mar 23, 2012, 3:32:43 PM3/23/12
to lu...@googlegroups.com
>
> looks pretty good, it has Etags, Chunks, etc...
>

Yeah. We use it at livit.io ( try stress-testing it :)

Reply all
Reply to author
Forward
0 new messages