Your SlideShare is downloading. ×
0
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
Download It
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

Download It

199

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
199
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
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. Investigating the impact of Ajax on server load in a Web 2.0 application Brian Toone Samford University [email_address]
  2. What is Web 2.0? Mind Map by Markus Angermeier Brian Toone, Samford University November 21, 2008
  3. Our focus Brian Toone, Samford University November 21, 2008 Mind Map by Markus Angermeier
  4. Web 2.0 example <ul><li>Facebook </li></ul><ul><ul><li>Popular social networking web application </li></ul></ul><ul><ul><li>Web 2.0 application </li></ul></ul><ul><ul><ul><li>Social software, encourages participation, sharing </li></ul></ul></ul><ul><ul><ul><li>Convergence, 3 rd party applications </li></ul></ul></ul><ul><ul><ul><li>and most importantly for this talk … usability </li></ul></ul></ul>November 21, 2008 Brian Toone, Samford University Toone
  5. November 21, 2008 Brian Toone, Samford University Toone
  6. Usability enhancements <ul><li>Reduce number of context switches </li></ul><ul><ul><li>User constantly sees context of page updates </li></ul></ul><ul><ul><li>No browser busy icon or screen flicker </li></ul></ul><ul><ul><li>Minimal change to the updated page </li></ul></ul><ul><li>Reduce latency by reducing server load </li></ul><ul><ul><li>Retrieve only what is necessary to update the page </li></ul></ul><ul><ul><li>Reduces the amount of data fetched from server </li></ul></ul><ul><ul><li>Reduces overall server load </li></ul></ul>November 21, 2008 Brian Toone, Samford University Toone
  7. Web Architecture 101 <ul><li>Web servers store web pages (static and dynamic) </li></ul><ul><li>Web browsers use HTTP to request pages </li></ul><ul><ul><li>Static page simply fetched from server hard drive </li></ul></ul><ul><ul><li>Scripts must execute to create dynamic pages (e.g., php, jsp) </li></ul></ul><ul><ul><li>HTML document sent to the web browser </li></ul></ul><ul><ul><li>Images, CSS, Javascript require additional HTTP requests </li></ul></ul><ul><ul><li>Same initial process for Ajax and non-Ajax pages </li></ul></ul>November 21, 2008 Brian Toone, Samford University Toone
  8. Ajax 101 <ul><li>Ajax – A synchronous J avascript A nd X ML </li></ul><ul><li>Ajax affects what happens after the initial page load </li></ul><ul><li>Ajax-enabled page has Javascript code to submit HTTP requests asynchronously without refreshing the current page </li></ul>November 21, 2008 Brian Toone, Samford University Toone
  9. Ajax 101 November 21, 2008 Brian Toone, Samford University Toone
  10. Ajax 101 … without Ajax or Ajax-equivalent <ul><li>Impossible to submit data without page refresh </li></ul><ul><li>Impossible to update the display with new data from the server without page refresh </li></ul><ul><li>Impact of a page refresh: </li></ul>November 21, 2008 Brian Toone, Samford University Toone
  11. So far, so good, so what is the problem? <ul><li>Facebook data requirements are relatively small </li></ul><ul><li>Facebook user interactions are relatively limited </li></ul><ul><li>Consider a mapping application… </li></ul>November 21, 2008 Brian Toone, Samford University Toone Without Ajax With Ajax
  12. The Ajax impact on server load <ul><li>Without Ajax, user “encouraged” to use appropriate zoom tools to minimize the number of requests </li></ul><ul><li>With Ajax, the opposite is true – the Rich Internet Application (RIA) “encourages” the user to zoom and pan </li></ul><ul><ul><li>Potential explosive increase in HTTP requests </li></ul></ul><ul><ul><li>Web server must respond to each request </li></ul></ul><ul><ul><li>Increase in bandwidth and processing load </li></ul></ul>November 21, 2008 Brian Toone, Samford University Toone
  13. Our focus and goal <ul><li>Our focus is not to argue whether Ajax increases or decrease server load in general </li></ul><ul><ul><li>That debate is meaningless because…. </li></ul></ul><ul><ul><li>The answer is entirely dependent upon… </li></ul></ul><ul><ul><ul><li>Specific website implementation of Ajax functionality </li></ul></ul></ul><ul><ul><ul><li>The overall usage of the site by the target audience </li></ul></ul></ul><ul><li>Our goal: a developer tool for quantifying the impact of Ajax performance on a web server hosting a specific Web 2.0 application </li></ul>November 21, 2008 Brian Toone, Samford University Toone
  14. An Extreme Example <ul><li>Each Ajax request consumes server resources </li></ul><ul><ul><li>CPU cycles </li></ul></ul><ul><ul><li>Bandwidth </li></ul></ul><ul><ul><li>Disk I/O </li></ul></ul><ul><li>Extreme Example </li></ul><ul><ul><li>An onmousemoveevent initiates an Ajax request to retrieve data from the server. </li></ul></ul><ul><ul><li>Every time every user moves the mouse, a new request is issued! </li></ul></ul>November 21, 2008 Brian Toone, Samford University Toone
  15. onmousemove Example, cont’d November 21, 2008 Brian Toone, Samford University Toone
  16. Our Ajax Performance Monitoring Toolkit <ul><li>See the server impact of Ajax calls in real-time </li></ul><ul><li>Not meant to be a load tester, many already exist </li></ul><ul><li>Help a web developer before the site is deployed </li></ul><ul><ul><li>Measurement for the client (individual page) </li></ul></ul><ul><ul><li>Measurement for the server (all accesses) </li></ul></ul>November 21, 2008 Brian Toone, Samford University Toone
  17. What do we measure? ( currently) <ul><li>Client measurements </li></ul><ul><ul><li>Total number of Ajax calls made from an individual page </li></ul></ul><ul><ul><li>Total number of Ajax responses received from server </li></ul></ul><ul><ul><li>Total number of “pending” page calls still awaiting responses </li></ul></ul><ul><li>Server load measurements </li></ul><ul><ul><li>Total number of Ajax calls processed </li></ul></ul><ul><ul><li>Total number of Ajax calls currently being processed </li></ul></ul><ul><ul><li>Throughput (calls/min) </li></ul></ul>November 21, 2008 Brian Toone, Samford University Toone
  18. Integrating toolkit into web apps <ul><li>CLIENT SIDE </li></ul><ul><li>Javascript “include” file </li></ul><ul><li><div> for output </li></ul><ul><li>Global variable declaration </li></ul><ul><li>Init global variable in onload function </li></ul><ul><li>Wrap Ajax request creation and cleanup </li></ul><ul><li>SERVER SIDE </li></ul><ul><li>Make sure each Ajax service script is isolated (cannot be loaded independently from an Ajax request) </li></ul><ul><li>Include the provided header and footer at the top and bottom of each Ajax service request </li></ul><ul><li>Do not die() </li></ul>November 21, 2008 Brian Toone, Samford University
  19. Integrating toolkit - clientside November 21, 2008 Brian Toone, Samford University
  20. Integrating toolkit - serverside <ul><li>Not as much to show! </li></ul><ul><li>Necessary monitoring code embedded in the header and footer scripts </li></ul>November 21, 2008 Brian Toone, Samford University
  21. Conclusion <ul><li>Measuring the impact of Ajax calls is tricky </li></ul><ul><li>The Ajax Performance Monitoring toolkit can give a web developer real-time display of Ajax calls and impact on server load </li></ul>November 21, 2008 Brian Toone, Samford University Toone
  22. Future Work <ul><li>Finer granularity of reported statistics (individual “named” Ajax calls) </li></ul><ul><li>Better isolation of the specific Ajax impact on server load … count and report specific # of cpu cycles spent executing Ajax functions </li></ul><ul><li>Less dependence on web developer following conventions correctly (e.g., could have negative number of outstanding requests if developer calls cleanup multiple times per single request) </li></ul>November 21, 2008 Brian Toone, Samford University Toone
  23. Thank you! <ul><li>Questions? </li></ul><ul><li>For more information </li></ul><ul><ul><li>[email_address] </li></ul></ul><ul><ul><li>http://faculty.samford.edu/~brtoone </li></ul></ul>Brian Toone, Samford University November 21, 2008 Toone
  24. Notes <ul><ul><ul><ul><li>Min/Max/Avg CPU load for the entire time a user interacts with the page </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Min/Max/Avg CPU load for the most recent burst of activity (defined as delay > 5 seconds between user interaction) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Real-time display of current server load </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>CPU load </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Bandwidth </li></ul></ul></ul></ul></ul>November 21, 2008 Brian Toone, Samford University Toone

×