MapReduceの"Hello World"は単語数数え上げ
The “Hello World” of MapReduce is to perform a distributed word count.
http://wiki.github.com/documentcloud/cloud-crowd/writing-an-action:site
workersを5つつくる
# crowd workers start -n 5
Job実行
# ruby word_count_example.rb
結果
>> Net::HTTP.start("localhost",9173) do |http| ?> res = http.get("/jobs/1") >> puts res.body >> end {"status":"succeeded","percent_complete":100,"time_taken":13.8203,"work_units":0,"id":1,"outputs":[532047],"color":"f75849"} => nil
workersを30つくる
# crowd workers start -n 30
Job実行
# ruby word_count_example.rb
結果
>> Net::HTTP.start("localhost",9173) {|http| puts http.get("/jobs/5").body } {"status":"succeeded","percent_complete":100,"time_taken":11.7305,"work_units":0,"id":5,"outputs":[532047],"color":"4a318d"}
大して差がなかった!5秒以下とかで完了を期待してたんだけども!