・ Web系SE募集 (技術開発部開発系エンジニア・Java/Tomcat 420万円~750万円)
   ・ 社内SE募集 (業務系システムの開発・社内イントラ)

Ruby on Rails Ver.2 + mod_rails (mod_passenger)で Apache Bench と メモリ使用状況を確認する。

user-pic
0

Ruby on Rails Ver.2 + mod_rails (mod_passenger) で "Hello, world!" 』で用意したもので確認します。



Apache設定ファイル
$ cat mod_rails.conf
LoadModule passenger_module   /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so
PassengerRoot                 /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby                 /usr/bin/ruby

$ cat app/views/helloworld/index.html.erb
<h1>Helloworld#index</h1>
Rails with mod_rails
<p>Find me in app/views/helloworld/index.html.erb</p>


$ curl "http://localhost/helloworld"
<h1>Helloworld#index</h1>
Rails with mod_rails
<p>Find me in app/views/helloworld/index.html.erb</p>

Apache Bench
$  ab -n 10000 -c 100  "http://localhost/helloworld"
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 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
Finished 10000 requests


Server Software:        Apache/2.2.9
Server Hostname:        localhost
Server Port:            80

Document Path:          /helloworld
Document Length:        101 bytes

Concurrency Level:      100
Time taken for tests:   56.952122 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      7000001 bytes
HTML transferred:       1010000 bytes
Requests per second:    175.59 [#/sec] (mean)
Time per request:       569.521 [ms] (mean)
Time per request:       5.695 [ms] (mean, across all concurrent requests)
Transfer rate:          120.01 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   5.1      0      70
Processing:    50  565 716.6    490   14510
Waiting:       40  562 706.0    490   14510
Total:        110  566 716.5    490   14510

Percentage of the requests served within a certain time (ms)
  50%    490
  66%    510
  75%    520
  80%    530
  90%    610
  95%   1030
  98%   1160
  99%   1610
 100%  14510 (longest request)


メモリの使用状況
top - 17:34:30 up 20 min,  2 users,  load average: 6.34, 6.10, 4.26
Tasks:  72 total,   8 running,  64 sleeping,   0 stopped,   0 zombie
Cpu(s): 82.7%us, 15.2%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  2.2%si,  0.0%st
Mem:    256400k total,   253792k used,     2608k free,      540k buffers
Swap:   524280k total,    18708k used,   505572k free,    21388k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 3041 suzu      25   0 45680  31m 1584 R 10.9 12.5   0:23.41 ruby
 3043 suzu      25   0 45680  31m 1584 R 14.5 12.5   0:23.71 ruby
 3045 suzu      25   0 45680  31m 1584 R 14.5 12.5   0:23.43 ruby
 3049 suzu      25   0 45680  31m 1584 R 13.0 12.5   0:23.48 ruby
 3047 suzu      25   0 45668  31m 1584 R 10.9 12.5   0:23.12 ruby
 3051 suzu      25   0 45676  31m 1584 R 14.5 12.5   0:23.31 ruby
 3039 suzu      20   0 32712  18m 1016 S  0.0  7.3   0:00.72 ruby
 3008 root      15   0 32708  13m 1916 S  0.0  5.2   0:03.58 ruby
 3078 suzu      15   0  8844 3252 1676 S  5.4  1.3   0:01.63 ab
 2756 root      15   0 12988 2216 1756 S  0.0  0.9   0:00.98 httpd
 2710 suzu      15   0  6440 2072 1296 S  0.0  0.8   0:00.89 bash
 3055 apache    15   0 12988 1888 1288 S  0.4  0.7   0:00.85 httpd
 3057 apache    15   0 12988 1888 1288 S  0.7  0.7   0:00.82 httpd
 3058 apache    15   0 12988 1888 1288 S  1.1  0.7   0:00.75 httpd
 3061 apache    16   0 12988 1888 1288 S  0.4  0.7   0:00.81 httpd
 3063 apache    15   0 12988 1888 1288 S  0.0  0.7   0:00.73 httpd
 3064 apache    15   0 12988 1888 1288 S  0.7  0.7   0:00.74 httpd
 3069 apache    15   0 12988 1888 1288 S  1.1  0.7   0:00.82 httpd
 3070 apache    15   0 12988 1888 1288 S  0.7  0.7   0:00.80 httpd
 3071 apache    15   0 12988 1888 1288 S  0.7  0.7   0:00.75 httpd
 3076 apache    15   0 12988 1888 1288 S  0.4  0.7   0:00.55 httpd
 3079 apache    15   0 12988 1888 1288 S  0.0  0.7   0:00.17 httpd
 3011 apache    15   0 12988 1884 1288 S  1.1  0.7   0:00.97 httpd
 3012 apache    15   0 12988 1884 1288 S  1.1  0.7   0:01.08 httpd
 3018 apache    15   0 12988 1884 1288 S  0.0  0.7   0:00.76 httpd
 3023 apache    16   0 12988 1884 1288 S  0.7  0.7   0:00.85 httpd
 3024 apache    15   0 12988 1884 1288 S  1.1  0.7   0:01.07 httpd
 3026 apache    15   0 12988 1884 1288 S  0.0  0.7   0:00.76 httpd
 3029 apache    15   0 12988 1884 1288 S  2.5  0.7   0:00.98 httpd
 2999 apache    15   0 12988 1848 1288 S  0.4  0.7   0:00.97 httpd
 3009 apache    15   0 12988 1836 1288 S  1.1  0.7   0:00.82 httpd

トラックバック(0)

トラックバックURL: http://arbolbell.jp/mt5/mt-tb.cgi/123

コメントする

このブログ記事について

このページは、Yuji Suzukiが2008年11月19日 23:22に書いたブログ記事です。

ひとつ前のブログ記事は「easy_install を使えるようにインストールする。」です。

次のブログ記事は「Django Ver.1 + mod_pythonで Apache Bench と メモリ使用状況を確認する。」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。