OutSystems - When it's Slow it Sucks: Lessons From The Trenches - NextStep 2012

3,590 views
3,283 views

Published on

Knowing your application has a performance problem is half the battle. Fixing the problem typically falls into one of several categories. In this session learn from performance problems encountered across the OutSystems ecosystem and the approach taken to find and address each issue.

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
3,590
On SlideShare
0
From Embeds
0
Number of Embeds
53
Actions
Shares
0
Downloads
43
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

OutSystems - When it's Slow it Sucks: Lessons From The Trenches - NextStep 2012

  1. 1. © outsystems 2012 When It's Slow it Sucks Lessons Learned From the Trenches
  2. 2. © outsystems 2012 Good applications have at least one thing in common: they are really fast. © outsystems 2012
  3. 3. © outsystems 2012 built-in agileplatform™
  4. 4. © outsystems 2012 viewstate reduction through R/W analysis partial screen rendering through visual AJAX automatic AJAX queuing smart prevention of duplicated AJAX requests automatic end-users activity monitoring user interface logic database agileplatform™
  5. 5. © outsystems 2012 unlimited horizontal scalability built-in distributed session management automated batch processing scaling batch processes instrumentation & monitoring integrations instrumentation & monitoring automatic monitoring of all errors built-in logs rotation persistence of logs in bulk asynchronous logging through messaging user interface logic database agileplatform™
  6. 6. © outsystems 2012 database connection pooling unused database connections unloading optimized fields fetch optimized dataset memory load queries automatic instrumentation & monitoring primary & foreign keys automatic indexing user interface logic database agileplatform™
  7. 7. © outsystems 2012 Beyond built-in agileplatform™ optimizations, keep these performance best practices in mind.
  8. 8. © outsystems 2012 la Palisse truth
  9. 9. © outsystems 2012 •  Creating indexes for the most used entity attributes will significantly improve the performance of select queries –  at the cost of slight overhead in insert and update operations. la Palisse truth #1 Index your entities
  10. 10. © outsystems 2012 Lesson Learned From the Trenches
  11. 11. © outsystems 2012 Lesson Learned From the Trenches #1 Monitor your indexes Uncover Hidden Data to Optimize Application Performance (Ian Stirk) http://msdn.microsoft.com/en-us/magazine/cc135978.aspx SQL Server
  12. 12. © outsystems 2012 •  Costly Missing Indexes –  Indexes that you may consider adding •  Unused Indexes –  Not needed indexes (they hurt performance too) •  Costly Used Indexes –  Indexes hurting insert / update operations Lesson Learned From the Trenches #1 Monitor your indexes
  13. 13. © outsystems 2012 •  Reorganization of indexes and statistics update –  Don't forget to involve the resident DBA. la Palisse truth #2 Setup database maintenance plan
  14. 14. © outsystems 2012 the maintenance plan was being executed but…it was stopping due to an error Inevitably, this was leading to performance degradation. Lesson Learned From the Trenches #2 Ensure execution is being monitored
  15. 15. © outsystems 2012 •  Avoid the use of 2000+ characters in a text field. –  Data fields greater than 2000 bytes are converted into a Text data type. •  As a rule, isolate binary and/or large text fields in separate entities –  And only retrieve them when they are strictly necessary la Palisse truth #3 Isolate large text and binary data
  16. 16. © outsystems 2012 •  allows fast and flexible indexing for keyword-based querying of text data •  also, To search inside the binary files stored in database using Ifilters How-to install, configure and use Full Text Search agile network Lesson Learned From the Trenches #3 Use Full-Text Search
  17. 17. © outsystems 2012 •  Cross server joins are very inefficient. –  The table in the linked server is completely loaded to the local DB in order to perform the join. •  May be acceptable if the tables are small and unavoidable. la Palisse truth #4 Don't join over linked server
  18. 18. © outsystems 2012 •  Apply the recommended settings from the installation checklist. la Palisse truth #5 Configure web server memory settings
  19. 19. © outsystems 2012 •  Affects user experience, therefore should be simple and fast to execute. •  Also avoid using functions accessing the DB in Table/List Records. la Palisse truth #6 Simplify screen preparations
  20. 20. © outsystems 2012 •  Increases network traffic between the server and the browser. la Palisse truth #7 Avoid using preparation data in screen actions
  21. 21. © outsystems 2012 •  Use Service Studio’s build-in caching features (5.1+): –  Queries –  Actions –  Web blocks –  Screens. la Palisse truth # 8 Cache, baby, cache
  22. 22. © outsystems 2012 What about the lessons?
  23. 23. © outsystems 2012 la Palisse…The obvious •  Index your entities •  Setup database maintenance plan •  Isolate large text and binary data •  Don't join over linked server •  Configure web server memory settings •  Simplify screen preparations •  Avoid using preparation data in screen actions •  Cache, baby, Cache
  24. 24. © outsystems 2012 80% of the end-user response time is spent on the browser •  downloading all the components in the page: images, .css, scripts, flash, … •  The goal: Reducing the number of components in turn reduces the number of HTTP requests required to render the page
  25. 25. © outsystems 2012 Let’s start with…
  26. 26. © outsystems 2012 •  The preferred method for reducing the number of image requests. •  Group multiple images together (usually icons or decorative images) into one sprite. •  Position the sprite to display the appropriate image by shifting the X or Y position by a multiple of the spacing. Lesson Learned From the Trenches #4 CSS sprites
  27. 27. © outsystems 2012 Lesson Learned From the Trenches #4 CSS sprites Enjoy the increased speed and reduced HTTP requests.
  28. 28. © outsystems 2012 •  Moving stylesheets to the document HEAD makes pages  appear  to be loading faster, it allows the page to render progressively •  The problem with putting stylesheets near the bottom of the document is that it prohibits progressive rendering in many browsers •  Some browsers block rendering to avoid having to redraw elements of the page if their styles change. Lesson Learned From the Trenches #5 Put Stylesheets at the Top
  29. 29. © outsystems 2012 •  The problem caused by scripts is that they block parallel downloads. •  The HTTP/1.1 specification suggests that browsers download no more than two components in parallel per hostname. •  While a script is downloading, the browser won't start any other downloads. Lesson Learned From the Trenches #6 Put Scripts at the Bottom
  30. 30. © outsystems 2012 Lesson Learned From the Trenches #7 Minify CSS / JS files
  31. 31. © outsystems 2012 Lesson Learned From the Trenches #7 really…minify it! minifyjs.com jscompress.com …
  32. 32. © outsystems 2012 •  JavaScript and CSS files are cached by the browser. •  JavaScript and CSS that are inlined in HTML documents get downloaded every time the HTML document is requested. –  reduces the number of HTTP requests needed –  increases the size of the HTML document. Lesson Learned From the Trenches #8 Make JavaScript and CSS External
  33. 33. © outsystems 2012 Lessons Learned From the Trenches
  34. 34. © outsystems 2012 •  Monitor your indexes •  Ensure Database maintenance is being monitored •  Use Full-Text Search •  CSS sprites •  Put Stylesheets at the Top •  Put Scripts at the Bottom •  Minify CSS / JS files •  Make JavaScript and CSS External To keep in mind
  35. 35. © outsystems 2012 http://www.fiddler2.com/ http://yslow.org/ https://developers.google.com/speed/pagespeed/ http://www.websiteoptimization.com search for…
  36. 36. © outsystems 2012 •  How to tune the TCP/IP stack for high volume of web requests agile network •  Secrets to Building High Performance Apps nextstep11 presentation •  Spriting made easy http://spriteme.org/ •  Automatic Performance Optimizations http://www.outsystems.com/demos also search for…
  37. 37. © outsystems 2012 Thank You ricardo.araujo@outsystems.com Credits shared with Paulo Ramos and Miguel Antunes

×