think about the HTTP::Engine

 | 

2008-08-23

current performance

01:48 | はてなブックマーク - current performance - think about the HTTP::Engine

perl -Ilib tools/nop.pl + I::Standalone

/usr/sbin/ab -n 10000 http://localhost:9999/

Server Software:        
Server Hostname:        localhost
Server Port:            9999

Document Path:          /
Document Length:        2 bytes

Concurrency Level:      1
Time taken for tests:   33.316070 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      1340000 bytes
HTML transferred:       20000 bytes
Requests per second:    300.16 [#/sec] (mean)
Time per request:       3.332 [ms] (mean)
Time per request:       3.332 [ms] (mean, across all concurrent requests)
Transfer rate:          39.26 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     1    2  12.0      1     102
Waiting:        0    2  11.6      1     101
Total:          1    2  12.0      1     102

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      1
  80%      1
  90%      1
  95%      1
  98%      2
  99%    101
 100%    102 (longest request)

refactor the HTTP::Engine::Interface::Standalone

20:35 | はてなブックマーク - refactor the HTTP::Engine::Interface::Standalone - think about the HTTP::Engine

■fixed problems

  • keep-alive doesn't works(KeepAlive うごいてなかったのでなおした)
  • many code cleanup(コードがこんがらがってたので再構成)

■Q. Why don't keep-alive if Connection header contains 'te' ?(TE ヘッダがついてるとキープアライブ効かないというのはバグくさい)

id:yappo : why??

        my $keepalive_available =    $self->keepalive
                                  && index( $connection, 'keep-alive' ) > -1
                                  && index( $connection, 'te' ) == -1          # opera stuff   ←←←←←←← why need this?
        ;

■Why always set $protocols = '1.0' ?

id:yappo : why??(なんでこんなことしてるんでしょう?)

    # We better be careful and just use 1.0
    $protocol = '1.0'; # XXX I don't know about why this needed.
 |