Catalystのオーバーヘッド~FCGI.pmのオーバーヘッド

| |
そうだ。FastCGIのCで書いた最小版のab2も載せておこう。 同じ条件で2.652218秒しかかかっていない。FCGI.pmでのオーバーヘッドも結構あるのかな。 FCGI.pmのシンプルな奴も試してみよう。・・・うん。FCGI.pm自体は大して悪くない。 #include "fcgi_stdio.h" #include <stdlib.h> int main(int argc, char* argv[]){   int count = 0;   while(FCGI_Accept() >= 0)     puts("Content-type: text/html\r\n"            "\r\n"            "<h1>FastCGI Hello!</h1>\r\n"); }   # ab2 -k -c 1 -n 10000 http://localhost:8080/fcgi/tiny-cgi Server Software:        lighttpd/1.4.7 Server Hostname:        localhost Server Port:            8080 Document Path:          /fcgi/tiny-cgi2 Document Length:        26 bytes Concurrency Level:      1 Time taken for tests:   2.652218 seconds Complete requests:      10000 Failed requests:        0 Write errors:           0 Keep-Alive requests:    9412 Total transferred:      1747060 bytes HTML transferred:       260000 bytes Requests per second:    3770.43 [#/sec] (mean) Time per request:       0.265 [ms] (mean) Time per request:       0.265 [ms] (mean, across all concurrent requests) Transfer rate:          643.24 [Kbytes/sec] received   それからFCGI.pmを使っただけのもの。ふむ。1.2秒(/10000 req)程度のオーバーヘッドしかないのか。 #!/usr/bin/perl use FCGI; my $request = FCGI::Request(); while($request->Accept() >= 0) {     print("Content-type: text/html\r\n\r\nCongratulations, CatalystTestApp is on Catalyst!\n"); }   Concurrency Level:      1 Time taken for tests:   3.822896 seconds Complete requests:      10000 Failed requests:        0 Write errors:           0 Keep-Alive requests:    9412 Total transferred:      1977060 bytes HTML transferred:       490000 bytes Requests per second:    2615.82 [#/sec] (mean) Time per request:       0.382 [ms] (mean) Time per request:       0.382 [ms] (mean, across all concurrent requests) Transfer rate:          504.85 [Kbytes/sec] received  

Trackback URL for this post:

http://old.typemiss.net/trackback/5