richardhundt / shine

A Shiny Lua Dialect
Other
231 stars 18 forks source link

httpd.shn and wrk #63

Closed dvv closed 9 years ago

dvv commented 10 years ago

Current master. wrk built from current git master.

[dvv@pagocmb ~]$ wrk -t1 -c1 -d1s http://127.0.0.1:8000/
Running 1s test @ http://127.0.0.1:8000/
  1 threads and 1 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   200.87us   42.29us 704.00us   95.41%
    Req/Sec     4.07k   193.53     4.44k    71.43%
  3642 requests in 999.69ms, 423.24KB read
Requests/sec:   3643.13
Transfer/sec:    423.37KB
[dvv@pagocmb ~]$ wrk -t1 -c2 -d1s http://127.0.0.1:8000/
Running 1s test @ http://127.0.0.1:8000/
  1 threads and 2 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   222.28us   60.05us 798.00us   78.83%
    Req/Sec     7.93k     1.70k   11.89k    65.31%
  8014 requests in 999.76ms, 0.91MB read
Requests/sec:   8015.94
Transfer/sec:      0.91MB
[dvv@pagocmb ~]$ wrk -t1 -c3 -d1s http://127.0.0.1:8000/
Running 1s test @ http://127.0.0.1:8000/
  1 threads and 3 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     0.00us    0.00us   0.00us    -nan%
    Req/Sec     0.00      0.00     0.00      -nan%
  0 requests in 2.00s, 0.00B read
  Socket errors: connect 0, read 0, write 0, timeout 3
Requests/sec:      0.00
Transfer/sec:       0.00B
[dvv@pagocmb ~]$

Seems it doesn't survive more than 2 concurrent connections. Please, confirm/void that is not due to my somehow broken setup.

TIA, --Vladimir

richardhundt commented 10 years ago

Hi thanks for the report.

I’ll look into this as soon as I get a chance. If it’s any consolation, at one point it did work with a 1k connections.

On 28 Aug 2014, at 20:53, Vladimir Dronnikov notifications@github.com wrote:

Current master. wrk built from current git master.

[dvv@pagocmb ~]$ wrk -t1 -c1 -d1s http://127.0.0.1:8000/ Running 1s test @ http://127.0.0.1:8000/ 1 threads and 1 connections Thread Stats Avg Stdev Max +/- Stdev Latency 200.87us 42.29us 704.00us 95.41% Req/Sec 4.07k 193.53 4.44k 71.43% 3642 requests in 999.69ms, 423.24KB read Requests/sec: 3643.13 Transfer/sec: 423.37KB [dvv@pagocmb ~]$ wrk -t1 -c2 -d1s http://127.0.0.1:8000/ Running 1s test @ http://127.0.0.1:8000/ 1 threads and 2 connections Thread Stats Avg Stdev Max +/- Stdev Latency 222.28us 60.05us 798.00us 78.83% Req/Sec 7.93k 1.70k 11.89k 65.31% 8014 requests in 999.76ms, 0.91MB read Requests/sec: 8015.94 Transfer/sec: 0.91MB [dvv@pagocmb ~]$ wrk -t1 -c3 -d1s http://127.0.0.1:8000/ Running 1s test @ http://127.0.0.1:8000/ 1 threads and 3 connections Thread Stats Avg Stdev Max +/- Stdev Latency 0.00us 0.00us 0.00us -nan% Req/Sec 0.00 0.00 0.00 -nan% 0 requests in 2.00s, 0.00B read Socket errors: connect 0, read 0, write 0, timeout 3 Requests/sec: 0.00 Transfer/sec: 0.00B [dvv@pagocmb ~]$

Seems it doesn't survive more than 2 concurrent connections. Please, confirm/void that is not due to my somehow broken setup.

TIA, --Vladimir

— Reply to this email directly or view it on GitHub.

shortweekend commented 10 years ago

It may help you to know that I am encountering the same problem as @dvv on Linux (Debian 7) while on Mac OS X (Mavericks) everything runs fine and I can reach 1k connections and beyond. So the problem seems limited to the Linux implementation (FFI ?).

richardhundt commented 10 years ago

Yeah, it’s related to the epoll wrapper. A quick fix would be to build upoll.c with just the poll backend, but I’d like to fix it properly. So yeah, this narrows it down. Thanks.

On 30 Aug 2014, at 14:15, shortweekend notifications@github.com wrote:

It may help you to know that I am encountering the same problem as @dvv on Linux (Debian 7) while on Mac OS X (Mavericks) everything runs fine and I can reach 1k connections and beyond. So the problem seems limited to the Linux implementation (FFI ?).

— Reply to this email directly or view it on GitHub.

richardhundt commented 9 years ago

This should be fixed now with latest master.

shortweekend commented 9 years ago

Thanks! It's working here (Debian 7) and I'm getting over 6k connections with wrk -t10 -c100 http://127.0.0.1:8000/.

richardhundt commented 9 years ago

interesting result, that's quite slow (assuming you mean 6k req/sec)

this is what I get on a macbook pro 13 (2.6 GHz Core i5):

dev1:shine richard$ wrk -t10 -c100 http://127.0.0.1:8000/
Running 10s test @ http://127.0.0.1:8000/
  10 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.54ms  486.46us   6.61ms   70.14%
    Req/Sec     2.99k   411.76     4.33k    72.85%
  281050 requests in 9.98s, 31.90MB read
Requests/sec:  28152.86
Transfer/sec:      3.19MB

This uses the poll backend. What kind of machine d'you have?

richardhundt commented 9 years ago

ok, tested in a VirtualBox vm with 2 CPU's configured, and I get similar performance:

ubuntu@ubuntu-VirtualBox:~$ wrk -t10 -c100 http://127.0.0.1:8000/
Running 10s test @ http://127.0.0.1:8000/
  10 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.38ms    1.18ms  14.32ms   79.65%
    Req/Sec     2.44k   541.44     4.80k    61.06%
  230480 requests in 10.00s, 26.16MB read
Requests/sec:  23049.44
Transfer/sec:      2.62MB

So, I'm happy with that ;-)

shortweekend commented 9 years ago

Don't worry Richard ;) I'm on an old (Mid 2007) Santa Rosa MacBook Pro, running Debian 7 in VMware on a single CPU and 500 MB. So 6300 req/sec is practically a "miracle" for this machine!