狠狠撸
Search
Submit Search
Rubyで作った"mission critical"システムについて
?
0 likes
?
1,124 views
Mayumi Emori
2011/07/16 (土) @練馬文化センター
Read less
Read more
1 of 62
More Related Content
Rubyで作った"mission critical"システムについて
1.
Rubyで作った“mission critical”システムについて江森 真由美
2.
PROFILEMayumi Emori
(@emorima)KCS Carrot Corp.Asakusarb
3.
PROFILE2004
4.
PROFILERuby
5.
PROFILE2004
6.
PROFILECGIKit
7.
PROFILE2005
8.
PROFILERuby onRails
9.
PROFILERuby歴 7yearsFirst RubyKaigifor
尘别(超初心者)
10.
Today’s point notwebservice(framework)
11.
Today’s pointmissioncritical
12.
Today’s pointdaemonprocess
13.
Today’s pointRuby
14.
Today’s pointmissioncritical ?
15.
mission critical24時間365日、止まらないことを要求される基幹業務、あるいは、そのような業務遂行のために使用されるコンピュータシステムのこと。(中略)このような業務に使用されるシステムには、極めて高い信頼性や耐障害性、障害発生時に被害を最小に食い止める様々な機能、万全のサポート体制などが必要となる。 (IT用語辞典
别-奥辞谤诲蝉より)
16.
mission critical24 hours365
dayscannot stop!
17.
mission criticalhighreliability(高信頼性)
18.
mission critical
19.
mission criticalなにこれ?
20.
mission critical困
21.
whatsystem?
22.
100threadsWhat system?
23.
100processesWhat system?
24.
10,000threadsWhat system?
25.
UDPSocketWhat system?
26.
whatfor?
27.
collect datafromsensorson realtimeWhat
for?
28.
Last night,You were
protected by Ruby
29.
始まり产别驳颈苍苍颈苍驳
30.
Beginning2004Prototype Ruby 1.6.8
31.
Beginning10,000 threadsちゃんと起動しなかったcannot execute
32.
BeginningWhy?
33.
Beginningディスクリプタ上限を超えていたOver filedescriptor limit
34.
Beginningtimeout10,000 TimeoutErrorもっさりslow in
action
35.
BeginningThreadいつの間にか?刺さるthread stuck
36.
Beginning何とかしなければならない(must resolve the
problem)
37.
classThreadWatchdefinitialize(timer)
@update_time = nil@alive_timer = timer@mutex = Mutex.newenddefupdate@mutex.synchronizedo@update_time = Time.nowendenddef valid?@mutex.synchronizedoreturnfalseif!@update_time.nil? && (Time.now - @update_time) > @alive_timer) endtrueendend
38.
defself.thread_main(idx, watch)loop dowatch.update#スレッド処理endenddefself.main(argv)th_infos
= Hash.newforiin0…100w = ThreadWatch.new(600)th = Thread.new(i, w) do |idx, watch|thread_main(idx, watch)endth_infos[i] =[th, w] endcheck_threads(th_infos)end
39.
defself.check_threads(th_infos)loop doth_infos.eachdo |i,
info|th, w = infof_restart = falsecaseth.statuswhen“run”, “sleep”f_restart = true unless w.valid?elsef_restart = trueendiff_restartth.killth.jointh = Thread.new(i, w) do |idx, watch|thread_main(idx, watch)endth_infos[i] = [th, w] endend endend
40.
BeginningOver file descriptor
limitroot user timeoutselect()thread stuckown monitoring function.
41.
本番谤别苍别飞补濒
42.
renewal2009
43.
谤别苍别飞补濒蝉辫别别诲大量データの计算処理性能要件を満たすためC言语で开発
44.
renewalprocess count
45.
renewalover230processes
46.
Ifyou developed in
C
47.
fun?inRuby
48.
“Rubyすげぇ”(Great! Ruby)
49.
Benefits of
developing in RubyYes! This is Ruby(1)直観的 (intuitive)容易(easy)ThreadUDP/TCP Socket etc.
50.
Benefits of
developing in RubyYes! This is Ruby(2)useful methodsyieldinstance_eval etc.
51.
Benefits of
developing in RubyTest is fun. (テストは楽に楽しく)UDP/TCP Socket無限Loop
52.
think about...
53.
コード量が少なく、変更も容易异常ケースもテストで余裕でカバー罢丑谤别补诲も厂辞肠办别迟通信も简単に実装
54.
Rubyfor 大規模システム
55.
But...
56.
Expectations or Hope
in Rubyspeed(速度)
57.
Expectations or Hope
in Rubyhighreliability(高信頼性)
58.
まとめ(蝉耻尘尘补谤测)
59.
Today’s SummaryWeb Service以外でもRuby活躍!
60.
Thank you for
your attention.ご清聴ありがとうございました
61.
Thank you for
your attention.ご清聴ありがとうございました
62.
Rubyで作った“mission critical”システムについて江森 真由美