I ran the following stress test on two different instantiations of the SDS:
- production: http://saildataservice.concord.org/
- development: http://rails.dev.concord.org/sds
The test consisted of opening the offering page for portal realm 3. Then opening four separate offerings in tabbed windows in the browser and then in rapid sequence clicking on the html, xls, pdf, Show, and Run links for two workgroups in each offering. In effect I was quickly asking the SDS to create six different:
- html reports
- excel spreadsheet researcher reports
- generate a pdf copy of "Show all work" (mostof this work is done by a separate hybrid rails-java app)
- show all the returned data for a workgroup
- start a learner session
$ cd /web/rails.dev.concord.org/saildataservice
$ ps aux | grep /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi
This the approximate process state for the 12 instances of the production SDS (svn rev 258) after restarting lighttpd (his is the web server that manages most of the rails apps at CC). The production SDS is based on Rails 1.1.6 which was released over 18 months ago. The average process size is about 36K.
user pid mem state command ------------------------------------------------------------------------------------------------------------------------------------------------ lighttpd 21042 0.7 0.3 36884 32684 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21043 0.7 0.3 36892 32608 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21044 0.7 0.3 36892 32628 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21045 0.7 0.3 36884 32712 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21046 0.7 0.3 36896 32628 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21047 0.7 0.3 36892 32692 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21048 0.7 0.3 36888 32688 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21049 0.8 0.4 38752 34028 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21050 5.1 0.6 36896 32628 ? S 16:34 0:14 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21051 3.0 1.3 36892 32692 ? S 16:34 0:08 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21052 6.1 0.5 36888 32688 ? S 16:34 0:17 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21053 9.0 0.7 36884 32712 ? S 16:34 0:25 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi
This is the state of the processes after running my stress test. Note that processes 21042..21049 didn't even get touched. The average size of the processes that were used is now about 72K.
lighttpd 21042 0.7 0.3 36884 32684 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21043 0.7 0.3 36892 32608 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21044 0.7 0.3 36892 32628 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21045 0.7 0.3 36884 32712 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21046 0.7 0.3 36896 32628 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21047 0.7 0.3 36892 32692 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21048 0.7 0.3 36888 32688 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21049 0.8 0.4 38752 34028 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21050 5.1 0.6 56840 50248 ? S 16:34 0:14 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21051 3.0 1.3 117500 112880 ? S 16:34 0:08 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21052 6.1 0.5 54036 49304 ? S 16:34 0:17 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi lighttpd 21053 9.0 0.7 65900 61188 ? S 16:34 0:25 /usr/local/bin/ruby /web/rails.dev.concord.org/saildataservice/public/dispatch.fcgi
Here's the same test on the development SDS (svn rev 282) which is based on Rails 2.0.2. This is the most recent stable version of Rails.
$ cd /web/rails.dev.concord.org/sds
$ ps aux | grep /web/rails.dev.concord.org/sds/public/dispatch.fcgi
This is the initial state of the dev SDS processes. They average about 27K. This is about 22% less memory than the production SDS processes.
lighttpd 21008 0.2 0.2 26356 22080 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21009 0.2 0.2 26356 22060 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21010 0.2 0.2 26356 22160 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21011 0.2 0.2 26348 22168 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21012 0.2 0.2 26352 22156 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21013 0.2 0.2 26348 22080 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21014 0.2 0.2 27936 22748 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21015 0.3 0.4 38800 33660 ? S 16:34 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi
Here's the state of the dev SDS processes after my stress test. There are only 8 processes allocated for the development SDS and in this case only three of them appeared to have been hit by my stress test. After the stress test the processes that were used average about 48K in size, about 33% less than the SDS processes based on Rails 1.1.6.
lighttpd 21008 0.0 0.2 26356 22080 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21009 0.0 0.2 26356 22060 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21010 0.0 0.2 26356 22160 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21011 0.0 0.2 26348 22168 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21012 0.0 0.2 26352 22156 ? S 16:34 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21013 0.2 0.4 45664 40772 ? S 16:34 0:04 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21014 0.7 0.5 52644 47840 ? S 16:34 0:15 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 21015 1.0 0.5 47260 42532 ? S 16:34 0:21 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi
The dev SDS based on the newer rails code works properly with the reaper script that allows them to be reloaded. This is the result of running the command:
$ sudo script/process/reaper -a graceful Gracefuling 21008 Gracefuling 21009 Gracefuling 21010 Gracefuling 21011 Gracefuling 21012 Gracefuling 21013 Gracefuling 21014 Gracefuling 21015
Here's what the process state looks like after running the reaper script. Only 2 processes have been started but lighttpd will start more as needed.
lighttpd 25289 13.7 0.3 34628 29512 ? S 17:11 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25290 12.9 0.2 27968 22788 ? S 17:11 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi
This is the process state result after running my stress test.
lighttpd 25289 16.4 0.5 46700 41924 ? S 17:11 0:24 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25290 6.8 0.4 44568 39644 ? S 17:11 0:09 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25370 2.7 0.3 36524 31740 ? S 17:12 0:02 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25446 2.0 0.3 34608 29740 ? S 17:12 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi
I then tried another test. I opened four copies of the Brownian Motion DIY activity. In each instance I created four snapshot images of a Molecular Workbench model in the snapshot album. I then quit all four SAIL instances at the same time.
This is what the process state looked like just after the test:
lighttpd 25289 2.5 1.6 138828 134000 ? S 17:11 1:12 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25290 0.4 1.4 122420 117536 ? S 17:11 0:12 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25370 0.1 1.4 122624 117696 ? S 17:12 0:04 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25446 0.0 0.3 34608 29740 ? S 17:12 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi
This is what the process state looked like after 5 minutes without any more tests on my part:
lighttpd 25289 2.5 1.4 125400 120540 ? S 17:11 1:18 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25290 0.4 0.9 84376 79476 ? S 17:11 0:14 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25370 0.1 0.9 83600 78772 ? S 17:12 0:04 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi lighttpd 25446 0.0 0.3 34608 29740 ? S 17:12 0:01 /usr/local/bin/ruby /web/rails.dev.concord.org/sds/public/dispatch.fcgi