sausheong / polyglot

Polyglot is a distributed web framework that allows programmers to create web applications in multiple programming languages
626 stars 34 forks source link

Performance Stats #7

Closed johnjelinek closed 10 years ago

johnjelinek commented 10 years ago

Note: This is more discussion than an issue.

I'm running C# on Mono in this example, but I'm noticing that I can only get it to handle 20 requests per second. If I increase the concurrent requests any higher than 2, then the acceptor dies and cannot take anymore requests. In general, I think this test shows favorable results for a hello world message (~50ms for a response), but I would like to certainly serve more than 20 requests in a second.

$ curl http://localhost:8080/_/csharp/hello -v
* Adding handle: conn: 0x7f9d29004000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7f9d29004000) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /_/csharp/hello HTTP/1.1
> User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
> Host: localhost:8080
> Accept: */*
> Referer:
>
< HTTP/1.1 200 OK
< Content-Type: text/html
< Date: Thu, 17 Jul 2014 05:20:36 GMT
< Content-Length: 18
<
* Connection #0 to host localhost left intact
<h1>Hello C#!</h1>
$ ab -n 10000 http://localhost:8080/_/csharp/hello
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests

Server Software:
Server Hostname:        localhost
Server Port:            8080

Document Path:          /_/csharp/hello
Document Length:        18 bytes

Concurrency Level:      1
Time taken for tests:   503.939 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      1190000 bytes
HTML transferred:       180000 bytes
Requests per second:    19.84 [#/sec] (mean)
Time per request:       50.394 [ms] (mean)
Time per request:       50.394 [ms] (mean, across all concurrent requests)
Transfer rate:          2.31 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:    17   50  38.4     47    1218
Waiting:       17   50  38.4     47    1217
Total:         17   50  38.4     47    1218

Percentage of the requests served within a certain time (ms)
  50%     47
  66%     49
  75%     50
  80%     51
  90%     54
  95%     56
  98%     57
  99%     59
 100%   1218 (longest request)
sausheong commented 10 years ago

Thanks John. The C# responder looks great. The acceptor is still pretty raw at the moment, I can't say for sure why it dies. Would you like to send in a pull request with your C# on Mon responder? Then I can try that out and see what's wrong.

johnjelinek commented 10 years ago

Yes, I'll send a PR for that. On Jul 17, 2014 2:25 AM, "Sau Sheong Chang" notifications@github.com wrote:

Thanks John. The C# responder looks great. The acceptor is still pretty raw at the moment, I can't say for sure why it dies. Would you like to send in a pull request with your C# on Mon responder? Then I can try that out and see what's wrong.

— Reply to this email directly or view it on GitHub https://github.com/sausheong/polyglot/issues/7#issuecomment-49267320.

sausheong commented 10 years ago

Will continue in the PR