lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Mar 14, 2007, at 17:17, gary ng wrote:

I am playing with cgilua on my dreamhost account and
do some not very scientific benchmark(running ab from
another host where the ping latency is in the range of
30ms) among the following :

turbogear 0.5 request/sec
django    30 request/sec
cgilua(lua page) 9 request/sec
cgilua(simple print/cgilua.put) 70 request/sec

Out of curiosity, what ApacheBench options did you use?

With 10 concurrent connections performing a thousand requests each against HTTP.lua [1] running under tcpserver [2], I get the following:

% ../ucspi-tcp/tcpserver -o -D -H -l -R 0 1080 lua TestHTTP.lua&

% ab -n 1000 -c 10 http://localhost:1080/hello

Requests per second:    81.48 [#/sec] (mean)

Using persistent connections speed up things quite a bit as this doesn't require to start a new VM for each request:

% ab -n 1000 -c 10 -k http://localhost:1080/hello

Requests per second:    819.00 [#/sec] (mean)

Compiling your lua code (e.g. luac) does help a bit, specially if you are under a CGI type of environment.

[1] http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua
[2] http://cr.yp.to/ucspi-tcp/tcpserver.html