Your SlideShare is downloading. ×
0
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Scaling CometD by Kevin Nilson
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Scaling CometD by Kevin Nilson

1,992

Published on

Scaling CometD by Kevin Nilson at Java User Group Chennai …

Scaling CometD by Kevin Nilson at Java User Group Chennai

http://www.jugchennai.in/2011/05/16/web-2-0-with-kevin-nilson-14-may-2011-tenth-planet/

http://www.jugchennai.in

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

  • Be the first to like this

No Downloads
Views
Total Views
1,992
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
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

Transcript

  • 1. ScalingCometD to The Masses
    by Kevin Nilson
    Principal Architect / E*Trade Financial
  • 2. LearnaboutCometD and ScalingCometDApps
  • 3. Agenda
    Quick Intro to CometD
    Basic Steps (OutsideCometD)
    Advanced Steps (InsideCometD)
  • 4. Kevin Nilson
    Java Champion
    Co-authored Web 2.0 Fundamentals Book
    Leader Silicon Valley Web Developer JUG
    Lead Silicon Valley Google Tech User Group
    Leader Silicon Valley JavaScript Meetup
    Taught 7 Courses College Of San Mateo
    Winner of MySpace Editor's Choice Award for project YumieDate, at Open Social Weekend Apps hosted at Google
  • 5. Intro To CometD
    What’s Comet?
    What’s Bayeux?
    What’s CometD?
    Pushing Data to The Net over HTTP
    Channel & JSON Based Comet Protocol
    Comet Client and Server Implementation using Bayeux
    What’s WebSockets?
  • 6. DEMO
    Polling Interal
  • 7. Polling
  • 8. Long Polling
  • 9. Streaming
  • 10. Basic Steps (OutsideCometD)
    Reduce overhead
    Allow Multithreading
    Remove Simple Bottlenecks
  • 11. Remove Apache
    Apache Has 1 Thread Per Request Limit
    Browse
    Apache
    Jetty
  • 12. Separate Client Into Tiers
    Some high throughput some low
    Spreads broadcast over multiple threads
    Delivery to 5 channels can be handled by 5 threads
    Delivery to 1 Channel can be handled by only 1 thread
    /Player/GameUpdate
    High Volume
    /GameUpdate
    Publisher
    /Watcher/GameUpdate
    Low Volume
  • 13. Only Deliver Changed Fields
    50% Field Delivery Reduction
  • 14. Advanced Steps
    Move Customers to slower tier if they are not consuming fast enough
    Disconnect users with very “large” queues
    Auto adjust throttling if overall we are producing faster than we can consume (deliver to customers)
  • 15. Before, No InternalVisiblity
    filter
    Jetty
    JMS
    BayeuxService
    Browser
    LEDGEND
    I can see
    I can’t see
  • 16. Before – Full Story
    filter
    Jetty
    JMS
    BayeuxService
    Browser
    Queue
    LEDGEND
    I can see
    I can’t see
  • 17. After
    filter
    Jetty
    JMS
    BayeuxService
    Browser
    Queue
    DeliverListener
    QueueListener
    LEDGEND
    I can see
    I can’t see
  • 18. Queue & Deliver Listener Code
    client.addListener(newQueueListener() {
    public booleanqueueMaxed(Client client, Client client1, Message arg2) {

    }
    }
    client.addListener(newDeliverListener( ) {
    public void deliver(Client arg0, Queue<Message> queue) {

    }
    }
  • 19. Prevent Huge Queue
    filter
    Jetty
    JMS
    BayeuxService
    Browser
    Queue
    Check Queue Size:
    Disconnect Client if “Large”
    LEDGEND
    I can see
    I can’t see
  • 20. Measure Average Time in Queue
    filter
    Jetty
    JMS
    BayeuxService
    Browser
    Queue
    Check Time In Queue:
    Move Client to Slower Tier or Increase Overall Throttling
    LEDGEND
    I can see
    I can’t see
  • 21. Adjust Tier: Avg Queue Size of Client
    Platinum
    Gold
    Silver
    Bronze
    JMS
    MyBayeuxService
    Platinum = 100 updates / minute
    Gold = 50 updates / minute
    Silver = 25 updates / minute
    Bronze = 10 updates / minute
    LEDGEND
  • 22. Broadcast in CometD, not JMS
    JMS
    MyBayeuxService
    Browser
    Browser
    Browser
    JMS
    MyBayeuxService
    Browser
    Browser
    Browser
  • 23. Channel Create & RemoveListener
    JMS
    MyBayeuxService
    channelAdded
    channelRemoved
  • 24. ChannelBayeuxListener Code
    bayeux.addListener(newChannelBayeuxListener() {
    public void channelAdded(Channel channel) {
    // Code Here
    }
    public void channelRemoved(Channel channel) {
    // Code Here
    }
    });
  • 25. Adjust Tier Rate based on Avg Queue Size
    Platinum
    Gold
    Silver
    Bronze
    JMS
    MyBayeuxService
    Platinum = 100 updates / minute
    Gold = 50 updates / minute
    Silver = 25 updates / minute
    Bronze = 10 updates / minute
    Platinum = 50 updates / minute
    Gold = 25 updates / minute
    Silver = 10 updates / minute
    Bronze = 5 updates / minute
    LEDGEND
  • 26. Auto Throttle: Avg Message Delay
    filter
    Jetty
    JMS
    BayeuxService
    Browser
    Queue
    Platnium = 50 updates
    Gold = 25 updates
    Silver = 10 updates
    Bronze = 5 updates
    Platnium = 100 updates
    Gold = 50 updates
    Silver = 25 updates
    Bronze = 10 updates
    LEDGEND
  • 27. Summary
    CometD Intro
    Basic Steps
    Advanced Steps
    . . .
  • 28. Thanks
    kevin_nilson@dev.java.net
    Web2-book.com - Web2.0 Fundamentals

×