2008年11月07日

Update: Mojo作者のSebastianもベンチマークとってくれたよ! (new benchmark by Sebastian)
Mojo vs. HTTP::Engine - Sebastian Riedel - Perl and the Web
sri++
And if there is time, i make benchmark of FCGI.

本気bar効果でMojoが注目されてるのでHTTP::Engineとの速度差を簡単にとった。
そもそもMojo単体のWeb Serverの使い方が良くわからないので Mojolicious の CLI を見てそれっぽい Mojo::Server::Daemon を使った。

on New MacBook 2.4G

Mojo's source code

use strict;
use warnings;
use Mojo::Server::Daemon;

my $daemon = Mojo::Server::Daemon->new;
$daemon->port(8082);
$daemon->run;

HTTP::Engine's source code

use strict;
use warnings;
use HTTP::Engine;
use HTTP::Engine::Response;

HTTP::Engine->new(
    interface => {
        module          => 'ServerSimple',
        args => { port => 8081 },
        request_handler => sub {
            my $req = shift;
            HTTP::Engine::Response->new(
                body => 'Congratulations, your Mojo is working!',
            );
        },
    }
)->run;

Mojo's Apache Bench Result

bash-3.2$ ab -n 2000 -c 2 http://127.0.0.1:8082/
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 127.0.0.1 (be patient)
Completed 200 requests
Completed 400 requests
Completed 600 requests
Completed 800 requests
Completed 1000 requests
Completed 1200 requests
Completed 1400 requests
Completed 1600 requests
Completed 1800 requests
Completed 2000 requests
Finished 2000 requests


Server Software:
Server Hostname:        127.0.0.1
Server Port:            8082

Document Path:          /
Document Length:        38 bytes

Concurrency Level:      2
Time taken for tests:   4.229 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      318000 bytes
HTML transferred:       76000 bytes
Requests per second:    472.91 [#/sec] (mean)
Time per request:       4.229 [ms] (mean)
Time per request:       2.115 [ms] (mean, across all concurrent requests)
Transfer rate:          73.43 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       3
Processing:     2    4   0.7      4      11
Waiting:        1    3   0.6      3       9
Total:          2    4   0.8      4      11

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

HTTP::Engine's Apache Bench Result

$ ab -n 2000 -c 2 http://127.0.0.1:8081/
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 127.0.0.1 (be patient)
Completed 200 requests
Completed 400 requests
Completed 600 requests
Completed 800 requests
Completed 1000 requests
Completed 1200 requests
Completed 1400 requests
Completed 1600 requests
Completed 1800 requests
Completed 2000 requests
Finished 2000 requests


Server Software:
Server Hostname:        127.0.0.1
Server Port:            8081

Document Path:          /
Document Length:        38 bytes

Concurrency Level:      2
Time taken for tests:   1.912 seconds
Complete requests:      2000
Failed requests:        0
Write errors:           0
Total transferred:      230000 bytes
HTML transferred:       76000 bytes
Requests per second:    1045.86 [#/sec] (mean
Time per request:       1.912 [ms] (mean)
Time per request:       0.956 [ms] (mean, across all concurrent requests)
Transfer rate:          117.45 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0      10
Processing:     1    2   0.6      2      12
Waiting:        0    2   0.5      2       7
Total:          1    2   0.7      2      14

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

H::Eはlazy_requestがきいているお陰か、速度が倍くらい違う。
YappoはMojoでのベンチマークの仕方も判ってないから不公平感があるかもしれない。
sriが計測したベンチマークのコードとかどこかに無いかしら?

Posted by Yappo at 2008年11月07日 19:40 | TrackBack | Perl
Comments

Gold in WoW is usually called wow gold, which is as popular as wow power leveling among WoW gamers. Some even strive to find cheapest wow gold with fast delivery online. The same, warhammer gold and warhammer power leveling are hot topic in any game forums. As one of the most popular game, lineage 2 is also well known, running after lineage 2 adena is an interesting thing, too. Since last year, Aion released, we also provide gamers with cheap aion gold, aion account, aion cd key, aion power leveling and aion time card, which are necessities in the game. I believe a seasoned player, you would not be unfamiliar with darkfall online, maybe you are playing it now. If you really playing it, you can get cheapest darkfall gold, darkfall power leveling, darkfall account, darkfall cd key and darkfall time card in an instant from us. More, we are supplying age of conan gold (somebody call it aoc gold by short), lotro gold in Lord of the Ring Online, silkroad gold, the gold name in silk road, maple story mesos, which is the particular gold game in Maple Story, eve isk (the only currency in EVE Online), ffxi gil (also the gold in FFXI), eq2 gold and eq2 plat are the short forms of EverQuest II Platinum as well as rom gold that the gold in Runes of Magic, atlantica gold, gamers are chasing all the time and spellborn gold which mean your status in the game. Just come here now.

Posted by: wow gold at 2009年07月08日 15:55
Post a comment









Remember personal info?






コメントを投稿する前に↓の場所にnospamと入力してください。