<< Masa.20120220-update-crawler_pattern-drop-pointer-link-sbsm-test-heavy-access-oddb_org | Index | Masa.20120216-update-interaction-algorithm-fix-float-domain-err-add-migel-interactions-mobile-check-threads-oddb_org >>
Refer to http://dev.ywesee.com/uploads/$PageName//ch.oddb_crash_17.2.2012_05.29.txt
Commits
Refer to http://dev.ywesee.com/uploads/$PageName//ch.oddb_crash_17.2.2012_03.17.txt
Commits
Refer to http://dev.ywesee.com/uploads/$PageName//ch.oddb_crash_16.2.2012_19.49.txt
Commits
Refer to http://dev.ywesee.com/uploads/$PageName//ch.oddb_crash_16.2.2012_21.19.txt
Commits
Note
Experiment
#!/usr/bin/env ruby # index.rbx -- oddb -- hwyss@ywesee.com require 'sbsm/request' require 'util/oddbconfig' DRb.start_service('druby://localhost:0') begin request0 = SBSM::Request.new('druby://localhost:10000') request1 = SBSM::Request.new('druby://localhost:98765') if Time.now.sec % 2 == 0 warn "A" request0.server_thread_count request0.process else warn "B" request1.server_thread_count request1.process end rescue Exception => e $stderr << "ODDB-Client-Error: " << e.message << "\n" $stderr << e.class << "\n" $stderr << e.backtrace.join("\n") << "\n" end
def thread_count Thread.list.length end
def server_thread_count @proxy ||= begin args = { 'database_manager' => CGI::Session::DRbSession, 'drbsession_uri' => @drb_uri, 'session_path' => '/', } if(is_crawler?) sleep 0.5 sid = [ENV['DEFAULT_FLAVOR'], @cgi.params['language'], @cgi.user_agent].join('-') args.store('session_id', sid) end session = CGI::Session.new(@cgi, args) session[:proxy] end @proxy.thread_count end
def main_loop Thread.start(@protocol.accept) do |client| @grp.add Thread.current p " #{Time.now}: @grp = #{@grp},@grp.list.length = #{@grp.list.length}, Thread.list.length = #{Thread.list.length}"
Run
Benchmark
$ /usr/sbin/ab -n 100 -c 100 http://oddb.masa.org/
Result
.... " 2012-02-17 16:19:45 +0100: @grp = #<ThreadGroup:0x0000000073a2f8>,@grp.list.length = 32, Thread.list.length = 38" " 2012-02-17 16:19:45 +0100: @grp = #<ThreadGroup:0x0000000073a2f8>,@grp.list.length = 33, Thread.list.length = 40" " 2012-02-17 16:19:45 +0100: @grp = #<ThreadGroup:0x0000000073a2f8>,@grp.list.length = 34, Thread.list.length = 40" " 2012-02-17 16:19:45 +0100: @grp = #<ThreadGroup:0x0000000073a2f8>,@grp.list.length = 35, Thread.list.length = 41" " 2012-02-17 16:19:45 +0100: @grp = #<ThreadGroup:0x0000000073a2f8>,@grp.list.length = 36, Thread.list.length = 42"
.... " 2012-02-17 16:20:00 +0100: @grp = #<ThreadGroup:0x00000001cd2908>,@grp.list.length = 64, Thread.list.length = 70" " 2012-02-17 16:20:01 +0100: @grp = #<ThreadGroup:0x00000001cd2908>,@grp.list.length = 64, Thread.list.length = 70" " 2012-02-17 16:20:03 +0100: @grp = #<ThreadGroup:0x00000001cd2908>,@grp.list.length = 64, Thread.list.length = 70" " 2012-02-17 16:20:08 +0100: @grp = #<ThreadGroup:0x00000001cd2908>,@grp.list.length = 64, Thread.list.length = 70"
Note
suspend