From: Ara.T.Howard@... Date: 2004-11-02T12:53:55+09:00 Subject: Re: fastcgi performance problems and ruby On Mon, 1 Nov 2004 andrew.stuart@xse.com.au wrote: > Can anyone throw any light for me on what sort performance I should > expect from ruby under mod_fastcgi? i can't run all of them - but here's the env test: [ahoward@www htdocs]$ cat env.fcgi #!/usr/local/ruby-1.8.0/bin/ruby require 'cgi' require 'fcgi' FCGI.each_cgi do |cgi| content = '' env = [] cgi.env_table.each{|k,v| env << [k,v]} env.sort! env.each{|k,v| content << %Q(#{k} => #{v}
\n)} cgi.out{content} end [ahoward@www htdocs]$ echo http://127.0.0.1/env.fcgi | http_load -verbose -parallel 100 -seconds 20 /dev/stdin 4420 fetches, 100 max parallel, 3.54926e+06 bytes, in 20.0237 seconds 803 mean bytes/connection 220.738 fetches/sec, 177253 bytes/sec msecs/connect: 5.67523 mean, 127.545 max, 0.203 min msecs/first-response: 86.2776 mean, 1077.36 max, 29.886 min HTTP response codes: code 200 -- 4420 [ahoward@www htdocs]$ ab -n 100 -c 100 -t 20 http://127.0.0.1/env.fcgi This is ApacheBench, Version 2.0.40-dev <$Revision: 1.116 $> apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient) Finished 4129 requests Server Software: Apache/2.0.47 Server Hostname: 127.0.0.1 Server Port: 80 Document Path: /env.fcgi Document Length: 829 bytes Concurrency Level: 100 Time taken for tests: 20.365556 seconds Complete requests: 4129 Failed requests: 0 Write errors: 0 Total transferred: 4244612 bytes HTML transferred: 3422941 bytes Requests per second: 202.74 [#/sec] (mean) Time per request: 493.232 [ms] (mean) Time per request: 4.932 [ms] (mean, across all concurrent requests) Transfer rate: 203.53 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 1.6 0 92 Processing: 71 483 105.3 468 1689 Waiting: 2 312 158.4 344 1299 Total: 71 483 105.3 468 1689 Percentage of the requests served within a certain time (ms) 50% 468 66% 490 75% 493 80% 495 90% 544 95% 657 98% 802 99% 879 100% 1689 (longest request) my machine info (it's a dog) [ahoward@www htdocs]$ uname -srm Linux 2.4.20-8 i686 [ahoward@www htdocs]$ cat /etc/redhat-release Red Hat Linux release 9 (Shrike) [ahoward@www htdocs]$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 5 model name : Pentium II (Deschutes) stepping : 2 cpu MHz : 398.273 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr bogomips : 794.62 [ahoward@www htdocs]$ cat /proc/meminfo total: used: free: shared: buffers: cached: Mem: 393760768 364519424 29241344 0 80605184 192499712 Swap: 263200768 11534336 251666432 MemTotal: 384532 kB MemFree: 28556 kB MemShared: 0 kB Buffers: 78716 kB Cached: 176740 kB SwapCached: 11248 kB Active: 241496 kB ActiveAnon: 40960 kB ActiveCache: 200536 kB Inact_dirty: 100 kB Inact_laundry: 57860 kB Inact_clean: 5604 kB Inact_target: 61012 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 384532 kB LowFree: 28556 kB SwapTotal: 257032 kB SwapFree: 245768 kB [ahoward@www htdocs]$ ruby -v ruby 1.8.0 (2003-09-22) [i686-linux] [ahoward@www htdocs]$ httpd -v Server version: Apache/2.0.40 Server built: Feb 25 2003 05:01:56 hope that's helpful. kind regards. -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================