Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
871
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
16
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

  • 1. Event Machine Ricardo Almeida @almeidaricardohttps://github.com/eventmachine/eventmachine
  • 2. PostRank Tools • Mysql, Ruby (API), Rails, Sinatra, Phyton, Java, JRuby, EC2, Nagios, Ganglia, Solr • Eventmachine, RabbitMQ • From XMPP to AMQP • Cassandra, Goliathhttp://webpulp.tv/post/4184040219/scaling-postrank-using-ruby-and-eventmachine-with-ilya
  • 3. Ilya Grigorik
  • 4. Event Machine• Fast, simple event-processing library for Ruby programs• Event-driven I/O• Reactor pattern
  • 5. Designed to• Extremely high scalability, performance and stability• An API that eliminates the complexities of high- performance threaded network programming
  • 6. Social Core• Escalabilidade• Disponibilidade - Todos requests devem ser respondidos• Consistência
  • 7. Architectures Job ManagerGET / POST Queue Server Event Process
  • 8. Tools• Rails 3.1.0.rc6• Ruby 1.9.2-head• Event-Machine• Thin• Goliath• Mysql (gem mysql2 v 0.3.6)• MongoDB• RabbitMQ (AMQP)
  • 9. EM-Tools• https://github.com/eventmachine/eventmachine/wiki• https://github.com/igrigorik/em-http-request• https://github.com/igrigorik/em-synchrony• https://github.com/postrank-labs/goliath
  • 10. Benchmarks• ApacheBench,Version 2.3• Autoperf (httperf)
  • 11. Provas!!
  • 12. Sleep Select (1 sec)• Tools: • ApacheBench • Rails 3.1.0.rc6 + Ruby 1.9.2-head + Mysql + webrick https://gist.github.com/1166610
  • 13. Sleep Select (1 sec) • ab -c 10 -n 10 http://localhost:3000/people/wait • Time taken for tests:   11.255 secondshttps://gist.github.com/1166610
  • 14. Sleep Select (1 sec)• Tools: Assync Rails • ApacheBench • webrick • Rails 3.1.0.rc6 + Ruby 1.9.2-head + Mysql + Thin + EventMachine https://gist.github.com/1166610
  • 15. Sleep Select (1 sec) • ab -c 10 -n 10 http://localhost:3000/people/wait • Time taken for tests:   2.371 secondshttps://gist.github.com/1166610
  • 16. Goliath• Heartbeat• Assync Upload• Routes• Validations
  • 17. Sleep Select (1 sec)• Tools: • ApacheBench • Rails 3.1.0.rc6 + Thin • Ruby 1.9.2-head + EventMachine + Mysql + Goliath https://gist.github.com/1166462
  • 18. Goliath +ActiveRecord
  • 19. Sleep Select (1 sec) • ab -c 10 -n 10 http://0.0.0.0:9000/wait?format=json • Time taken for tests:   2.198 secondshttps://gist.github.com/1166610
  • 20. HTTP assinc Req/Resp no MongoDB• Tools: • ApacheBench • Mysql • Ruby 1.9.2-head + EventMachine + Goliath + MongoDB
  • 21. HTTP assincReq/Resp no MongoDB• ab -c 10 -n 10 http://0.0.0.0:9000/teste?format=json• Time taken for tests:   0.209 seconds
  • 22. HTTP assincReq/Resp no MongoDB• ab -c 50 -n 50 http://0.0.0.0:9000/teste?format=json• Time taken for tests:   1.105 seconds
  • 23. EM + RabbitMQ
  • 24. EM + RabbitMQ
  • 25. Domínios• AAPG • Facebook• Anotations • Twitter• Activity (New) • Google+
  • 26. http://www.slideshare.net/hungryblank/distributed-and-concurrent-programming-with-rabbitmq-and-eventmachine-rails-underground-2009
  • 27. http://www.slideshare.net/hungryblank/distributed-and-concurrent-programming-with-rabbitmq-and-eventmachine-rails-underground-2009
  • 28. http://www.slideshare.net/hungryblank/distributed-and-concurrent-programming-with-rabbitmq-and-eventmachine-rails-underground-2009
  • 29. SPDYhttp://www.igvita.com/2011/04/07/life-beyond-http-11-googles-spdy/
  • 30. Obrigado! Ricardo Almeida @almeidaricardo