think about the HTTP::Engine

2008-08-28

NEXT

17:50 | はてなブックマーク - NEXT - think about the HTTP::Engine

2008-08-25

performance

23:28 | はてなブックマーク - performance - think about the HTTP::Engine

■ServerSimple

Checkout Path: /home/tokuhirom/project/HTTP-Engine
Depot Path: //mirror/coderepos/lang/perl/HTTP-Engine/branches/interface-declare
Revision: 26194
Last Changed Rev.: 26194
Mirrored From: http://svn.coderepos.org/share, Rev. 18222
Class::MOP: 0.64
Moose: 0.5501
HTTP::Server::Simple: 0.34
Server Software:        
Server Hostname:        localhost
Server Port:            9999

Document Path:          /
Document Length:        2 bytes

Concurrency Level:      1
Time taken for tests:   1.169580 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      78000 bytes
HTML transferred:       2000 bytes
Requests per second:    855.01 [#/sec] (mean)
Time per request:       1.170 [ms] (mean)
Time per request:       1.170 [ms] (mean, across all concurrent requests)
Transfer rate:          64.98 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     1    1   0.0      1       1
Waiting:        0    0   1.0      1       1
Total:          1    1   0.0      1       1

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

■POE

Class::MOP: 0.64
Moose: 0.5501
POE: 1.003
Server Software:        
Server Hostname:        localhost
Server Port:            9999

Document Path:          /
Document Length:        2 bytes

Concurrency Level:      1
Time taken for tests:   3.565853 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      78000 bytes
HTML transferred:       2000 bytes
Requests per second:    280.44 [#/sec] (mean)
Time per request:       3.566 [ms] (mean)
Time per request:       3.566 [ms] (mean, across all concurrent requests)
Transfer rate:          21.31 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:     3    3   0.2      3      10
Waiting:        2    3   0.2      3      10
Total:          3    3   0.3      3      11

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

■Standalone

Server Software:        
Server Hostname:        localhost
Server Port:            9999

Document Path:          /
Document Length:        2 bytes

Concurrency Level:      1
Time taken for tests:   1.709697 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      134000 bytes
HTML transferred:       2000 bytes
Requests per second:    584.90 [#/sec] (mean)
Time per request:       1.710 [ms] (mean)
Time per request:       1.710 [ms] (mean, across all concurrent requests)
Transfer rate:          76.04 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     1    1   0.4      1      13
Waiting:        0    0   0.0      0       0
Total:          1    1   0.4      1      13

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

HTTP::Engine interface-declare

08:55 | はてなブックマーク - HTTP::Engine interface-declare - think about the HTTP::Engine

  • delete RequestProcessor
  • build ResponseWriter by declaretive style
  • build RequestBuilder by declaretive style

2008-08-24

what's next?

00:54 | はてなブックマーク - what's next? - think about the HTTP::Engine

  • documentation
  • I HATE ModPerl::RequestBuilder
  • is RequestBuilder good solution?
  • we need ReqeuestProcessor?
  • we need ResponseWriter?
  • we need RequestBuilder?

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.