Vertx for worlddomination

2.530 Aufrufe

Veröffentlicht am

A variation of the talk I gave at JavaLand.

Veröffentlicht in: Technologie
0 Kommentare
4 Gefällt mir
Statistik
Notizen
  • Als Erste(r) kommentieren

Keine Downloads
Aufrufe
Aufrufe insgesamt
2.530
Auf SlideShare
0
Aus Einbettungen
0
Anzahl an Einbettungen
10
Aktionen
Geteilt
0
Downloads
19
Kommentare
0
Gefällt mir
4
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie

Vertx for worlddomination

  1. 1. World Domination + Vert.x
  2. 2. ?
  3. 3. DOES! IT! SCALE ?
  4. 4. CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU
  5. 5. C10K ZZZZZZZZZz ZZZZZZZZZz ZZZZZZZZZz
  6. 6. CPU ABC 42 1 2 3 4 5 6 7 8 9 0
  7. 7. volatile CyclicBarrier AtomicBoolean synchronized ReentrantLock AtomicInteger AtomicCafe Thread ThreadPoolExecutor Runnable Callable
  8. 8. contentionI/O
  9. 9. Single Thread 1 Thread w/ lock 2 Threads w/ lock 1 Thread w/ CAS 2 Threads w/ CAS Volatile 0 12500 25000 37500 50000 Contention https://github.com/codepitbull/lockperformance
  10. 10. I/O Acces type cycles L1- Cache 3 L2-Cache 14 RAM 250 Disk 41000000 Network 240000000 http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/
  11. 11. Channel A Channel B Channel C Channel D Selector Event Handler 1 Event Handler 2 Event Handler 3 Event Handler 4 Event Handler 5 12.10.2012
  12. 12. Quasar
  13. 13. 生 ॐ СВОБОДА Microservice! certified !
  14. 14. Verticle Module 1 0..n 0..n Verticle Module 1 0..n 0..n 1 System vert.x module1 verticle 1 verticle 2 module2 verticle 3 verticle 4
  15. 15. class MustacheRendererVerticle extends Verticle {
 
 DefaultMustacheFactory mf = new DefaultMustacheFactory( "de/codepitbull/javaland/mustache");
 
 @Override
 def start() {
 vertx.eventBus.registerHandler("template.render", { message ->
 Mustache mustache = mf.compile(message.body());
 StringWriter sw = new StringWriter();
 mustache.execute(sw, new Example()).flush();
 message.reply(sw.getBuffer().toString());
 });
 }
 
 }
  16. 16. import org.vertx.groovy.platform.Verticle
 
 class DemoVerticle extends Verticle {
 @Override
 Object start() {
 container.deployModule("io.vertx~mod-web-server~2.0.0-final", container.config)
 }
 } io.vertx~mod-web-server~2.0.0-final
  17. 17. official community 生 ॐ СВОБОДА
  18. 18. Verticle Verticle Verticle Verticle Verticle Verticle Verticle Verticle
  19. 19. mod 2mod 1 CPU CPU CPU CPU CPU CPU CPU CPU vertx -cluster CPU CPU CPU CPU CPU CPU CPU CPU mod 2mod 1 Multicast
  20. 20. mod 2mod 1 CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU vertx -ha mod ? mod ? mod ? mod ? mod ? mod ? mod ? mod ? CPU CPU CPU CPU CPU CPU CPU CPU mod 2mod 1
  21. 21. DEMO
  22. 22. Leseliste/Quellen http://martinfowler.com/articles/microservices.html http://www.cs.wustl.edu/~schmidt/PDF/reactor-siemens.pdf http://tutorials.jenkov.com/java-nio/selectors.html https://www.ibm.com/developerworks/java/library/j-jtp02225/ http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/ http://lmax-exchange.github.io/disruptor/ https://github.com/codepitbull/lockperformance

×