Skip to content

Instantly share code, notes, and snippets.

@matsumotory
Last active January 21, 2016 18:32
Show Gist options
  • Save matsumotory/6930672 to your computer and use it in GitHub Desktop.
Save matsumotory/6930672 to your computer and use it in GitHub Desktop.
ngx_mruby vs lua-nginx-module
$ /usr/local/apache/bin/ab -c 100 -n 100000 http://127.0.0.1/lua
Server Software: nginx/1.4.3
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /lua
Document Length: 13 bytes
Concurrency Level: 100
Time taken for tests: 7.197 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 16900000 bytes
HTML transferred: 1300000 bytes
Requests per second: 13894.30 [#/sec] (mean)
Time per request: 7.197 [ms] (mean)
Time per request: 0.072 [ms] (mean, across all concurrent requests)
Transfer rate: 2293.10 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.3 0 12
Processing: 2 7 0.8 7 25
Waiting: 1 7 0.8 7 25
Total: 5 7 0.8 7 25
$ /usr/local/apache/bin/ab -k -c 100 -n 100000 http://127.0.0.1/lua
Server Software: nginx/1.4.3
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /lua
Document Length: 13 bytes
Concurrency Level: 100
Time taken for tests: 2.691 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 99006
Total transferred: 17395030 bytes
HTML transferred: 1300000 bytes
Requests per second: 37156.92 [#/sec] (mean)
Time per request: 2.691 [ms] (mean)
Time per request: 0.027 [ms] (mean, across all concurrent requests)
Transfer rate: 6311.97 [Kbytes/sec] received
$ /usr/local/apache/bin/ab -c 100 -n 100000 http://127.0.0.1/mruby
Server Software: nginx/1.4.3
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /mruby
Document Length: 13 bytes
Concurrency Level: 100
Time taken for tests: 5.148 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 12900000 bytes
HTML transferred: 1300000 bytes
Requests per second: 19423.42 [#/sec] (mean)
Time per request: 5.148 [ms] (mean)
Time per request: 0.051 [ms] (mean, across all concurrent requests)
Transfer rate: 2446.90 [Kbytes/sec] received
$ /usr/local/apache/bin/ab -k -c 100 -n 100000 http://127.0.0.1/mruby
Server Software: nginx/1.4.3
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /mruby
Document Length: 13 bytes
Concurrency Level: 100
Time taken for tests: 1.991 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 99001
Total transferred: 13395005 bytes
HTML transferred: 1300000 bytes
Requests per second: 50227.56 [#/sec] (mean)
Time per request: 1.991 [ms] (mean)
Time per request: 0.020 [ms] (mean, across all concurrent requests)
Transfer rate: 6570.30 [Kbytes/sec] received
location /lua {
content_by_lua 'ngx.say("hello lworld")';
}
location /mruby {
mruby_content_handler_code 'Nginx.rputs "hello mworld\n"';
}
@maks
Copy link

maks commented Oct 17, 2013

@nikolay
Copy link

nikolay commented Jan 21, 2016

@matsumoto-r It's hugely important - did you use Lua or LuaJIT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment