Successfully reported this slideshow.
server-side web trackbrought to you by<br />
Getting out of Sync with IISand Riding a COMET<br /> Richard Banks		<br />richard-banks.org  @rbanks54<br />TalkingShopDow...
Goal: Improve your Server Side Performance<br />
WebForms,<br />MVC &<br />Comet<br />
Client side Things we already know(hopefully!)<br />
Fewer requests == more performance!<br />
View State Is EVIL!!! <br />
CDN’s, css sprites, minification, YSLOW, etc, etc<br />
Server side?<br />
Minimal DB calls,<br />Cache usage, AJAX, and so forth <br />
But what if you’ve done all that already?!<br />
What if you have “Hanging” Requests?<br />
Poor performance with very little load?<br />
Probably BLOCKingREQUEST THREADS<br />
Some IIS Internals<br />
IIS 6.0: 12request threads per CPU<br />Also IIS 7.0 in Classic pipeline mode<br />
20worker & 20 IO threads per CPU<br />
No free threads?<br />The request gets queued<br />PerfMon Counter:<br />ASP.NETRequests in Application Queue<br />
Limit is 5000 requests. Over that? 503 errors<br />PerfMon Counter:<br />ASP.NETRequests Current<br />
IIS 7.0 (Intg): <br />12 concurrent requests per CPU<br />Applies to .NET 2.0<br />
In .NET 4.0: 5000 per CPU!<br />
MS says do same in ASP.NET 2.0. Add registry key or edit aspnet.config<br />MaxConcurrentRequestsPerCPU<br />HKLMSOFTWAREM...
Note: App Pool Queue Length is 1000<br />
Before messing with configs… Get Async!<br />
Time For some Demo<br />fun!<br />
ASP.NET Web Forms<br />
Async=“true”<br />in page directive.<br />
REGISTERASYNCTASK and PageASYNCTASK<br />http://msdn.microsoft.com/en-us/library/system.web.ui.pageasynctask.aspx<br />
ASP.NET MVC<br />AsyncControlers<br />
Howz about USING that new ASYNC Keyword?!<br />
Now for the new Hawtness!<br />
COMET!<br />Aka “Reverse AJAX”<br />
Practical uses:<br />Stock ticker<br />Sports scores<br />Auction bidding<br />Bus Service GPS updates<br />Warehouse move...
Canonical Demo:<br />Web Chat<br />
Implement Via UpdatePanel?<br />Ajax Request on Enter:<br /><ul><li>No live update
Need to send full chat history each time
Uses Update Panel!</li></li></ul><li>AJAX && JSON<br />(aka wOOtage!)<br />Use a jssetTimeout() call<br />Only ask for mes...
Long Polling or StREAMING<br />(no, not web sockets)<br />
Bayeux Protocol<br />http://cometd.org/<br />Dojo & Jquery Bindings<br />
Lots of other Comet servers. I want TO USE IIS<br />IIS threading means no streaming support, only long polling.<br />
CHAT Demo: AspComet<br />(on Appharbor)<br />http://chat.richard-banks.org<br />
For better Comet go Threadless: Manos de Mono or Node.js<br />Just Remember Mordac will likely need bribing to deploy it<b...
Faye is a Bayeaux server for Node.JS<br />http://faye.jcoglan.com/<br />
Resources<br />Contention, poor performance, and deadlocks:  http://support.microsoft.com/kb/821268<br />ASP.NET Thread Us...
We would like to thank our sponsors and supporters for helping us bring you this event<br />
Upcoming SlideShare
Loading in …5
×

DDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet

3,076 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

DDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet

  1. 1. server-side web trackbrought to you by<br />
  2. 2. Getting out of Sync with IISand Riding a COMET<br /> Richard Banks <br />richard-banks.org @rbanks54<br />TalkingShopDownUnder.com<br />
  3. 3. Goal: Improve your Server Side Performance<br />
  4. 4. WebForms,<br />MVC &<br />Comet<br />
  5. 5. Client side Things we already know(hopefully!)<br />
  6. 6. Fewer requests == more performance!<br />
  7. 7. View State Is EVIL!!! <br />
  8. 8. CDN’s, css sprites, minification, YSLOW, etc, etc<br />
  9. 9. Server side?<br />
  10. 10. Minimal DB calls,<br />Cache usage, AJAX, and so forth <br />
  11. 11. But what if you’ve done all that already?!<br />
  12. 12. What if you have “Hanging” Requests?<br />
  13. 13. Poor performance with very little load?<br />
  14. 14. Probably BLOCKingREQUEST THREADS<br />
  15. 15. Some IIS Internals<br />
  16. 16. IIS 6.0: 12request threads per CPU<br />Also IIS 7.0 in Classic pipeline mode<br />
  17. 17. 20worker & 20 IO threads per CPU<br />
  18. 18. No free threads?<br />The request gets queued<br />PerfMon Counter:<br />ASP.NETRequests in Application Queue<br />
  19. 19. Limit is 5000 requests. Over that? 503 errors<br />PerfMon Counter:<br />ASP.NETRequests Current<br />
  20. 20. IIS 7.0 (Intg): <br />12 concurrent requests per CPU<br />Applies to .NET 2.0<br />
  21. 21. In .NET 4.0: 5000 per CPU!<br />
  22. 22. MS says do same in ASP.NET 2.0. Add registry key or edit aspnet.config<br />MaxConcurrentRequestsPerCPU<br />HKLMSOFTWAREMicrosoftASP.NET2.0.50727<br />
  23. 23. Note: App Pool Queue Length is 1000<br />
  24. 24. Before messing with configs… Get Async!<br />
  25. 25. Time For some Demo<br />fun!<br />
  26. 26. ASP.NET Web Forms<br />
  27. 27. Async=“true”<br />in page directive.<br />
  28. 28. REGISTERASYNCTASK and PageASYNCTASK<br />http://msdn.microsoft.com/en-us/library/system.web.ui.pageasynctask.aspx<br />
  29. 29. ASP.NET MVC<br />AsyncControlers<br />
  30. 30. Howz about USING that new ASYNC Keyword?!<br />
  31. 31. Now for the new Hawtness!<br />
  32. 32. COMET!<br />Aka “Reverse AJAX”<br />
  33. 33. Practical uses:<br />Stock ticker<br />Sports scores<br />Auction bidding<br />Bus Service GPS updates<br />Warehouse movements & logistics<br />Google+<br />Anything broadcasting events/msgs<br />
  34. 34. Canonical Demo:<br />Web Chat<br />
  35. 35. Implement Via UpdatePanel?<br />Ajax Request on Enter:<br /><ul><li>No live update
  36. 36. Need to send full chat history each time
  37. 37. Uses Update Panel!</li></li></ul><li>AJAX && JSON<br />(aka wOOtage!)<br />Use a jssetTimeout() call<br />Only ask for messages after msgId<br />Regular polling to get messages<br />
  38. 38. Long Polling or StREAMING<br />(no, not web sockets)<br />
  39. 39. Bayeux Protocol<br />http://cometd.org/<br />Dojo & Jquery Bindings<br />
  40. 40. Lots of other Comet servers. I want TO USE IIS<br />IIS threading means no streaming support, only long polling.<br />
  41. 41. CHAT Demo: AspComet<br />(on Appharbor)<br />http://chat.richard-banks.org<br />
  42. 42. For better Comet go Threadless: Manos de Mono or Node.js<br />Just Remember Mordac will likely need bribing to deploy it<br />
  43. 43. Faye is a Bayeaux server for Node.JS<br />http://faye.jcoglan.com/<br />
  44. 44. Resources<br />Contention, poor performance, and deadlocks: http://support.microsoft.com/kb/821268<br />ASP.NET Thread Usage on IIS 6.0 and IIS 7.0: http://blogs.msdn.com/b/tmarq/archive/2007/07/21/asp-net-thread-usage-on-iis-7-0-and-6-0.aspx<br />Improving ASP.NET Performance: http://msdn.microsoft.com/en-us/library/ff647787.aspx<br />PageAsyncTask: http://msdn.microsoft.com/en-us/library/system.web.ui.pageasynctask.aspx<br />MVC Async Controllers: http://msdn.microsoft.com/en-us/library/ee728598.aspx<br />Should DB Calls be Async? http://blogs.msdn.com/b/rickandy/archive/2009/11/14/should-my-database-calls-be-asynchronous.aspx<br />AspComet: http://github.com/nmosafi/aspcomet<br />Bayeux and Cometd: http://svn.cometd.com/trunk/bayeux/bayeux.html<br />Manos De Mono: http://github.com/jacksonh/manos<br />Node.JS: http://nodejs.org/<br />FAYE: http://faye.jcoglan.com/<br />
  45. 45. We would like to thank our sponsors and supporters for helping us bring you this event<br />
  46. 46. Please complete the feedback form in your delegate pack for a chance to win some great prizes.<br />Please remember to return the form before you enter the lock note, or leave the event. <br />

×