Event machine

1,212 views
1,127 views

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,212
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
21
Comments
0
Likes
3
Embeds 0
No embeds

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
  • Event machine

    1. 1. Event Machine Ricardo Almeida @almeidaricardohttps://github.com/eventmachine/eventmachine
    2. 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. 3. Ilya Grigorik
    4. 4. Event Machine• Fast, simple event-processing library for Ruby programs• Event-driven I/O• Reactor pattern
    5. 5. Designed to• Extremely high scalability, performance and stability• An API that eliminates the complexities of high- performance threaded network programming
    6. 6. Social Core• Escalabilidade• Disponibilidade - Todos requests devem ser respondidos• Consistência
    7. 7. Architectures Job ManagerGET / POST Queue Server Event Process
    8. 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. 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. 10. Benchmarks• ApacheBench,Version 2.3• Autoperf (httperf)
    11. 11. Provas!!
    12. 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. 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. 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. 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. 16. Goliath• Heartbeat• Assync Upload• Routes• Validations
    17. 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. 18. Goliath +ActiveRecord
    19. 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. 20. HTTP assinc Req/Resp no MongoDB• Tools: • ApacheBench • Mysql • Ruby 1.9.2-head + EventMachine + Goliath + MongoDB
    21. 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. 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. 23. EM + RabbitMQ
    24. 24. EM + RabbitMQ
    25. 25. Domínios• AAPG • Facebook• Anotations • Twitter• Activity (New) • Google+
    26. 26. http://www.slideshare.net/hungryblank/distributed-and-concurrent-programming-with-rabbitmq-and-eventmachine-rails-underground-2009
    27. 27. http://www.slideshare.net/hungryblank/distributed-and-concurrent-programming-with-rabbitmq-and-eventmachine-rails-underground-2009
    28. 28. http://www.slideshare.net/hungryblank/distributed-and-concurrent-programming-with-rabbitmq-and-eventmachine-rails-underground-2009
    29. 29. SPDYhttp://www.igvita.com/2011/04/07/life-beyond-http-11-googles-spdy/
    30. 30. Obrigado! Ricardo Almeida @almeidaricardo

    ×