Your SlideShare is downloading. ×
0
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
Java Enterprise Performance - Unburdended Applications
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

Java Enterprise Performance - Unburdended Applications

1,846

Published on

Looking at performance may quickly become a tuning exercise, the hunt for the last 2% algorithmic improvement or JVM parameter readjustment. This presentation takes a somewhat more removed look at …

Looking at performance may quickly become a tuning exercise, the hunt for the last 2% algorithmic improvement or JVM parameter readjustment. This presentation takes a somewhat more removed look at Enterprise Java performance - taking in the broader picture of the entire multi-tier architecture and applying common sense performance concepts from every day life an applying those to enterprise Java architectures. To serve as an eye opener.

(originally created for the Oracle Technology Day on Java Enterprise Performance, May 2011, The Netherlands)

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total Views
1,846
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
45
Comments
1
Likes
1
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
  • Process
  • Na een upgrade van SOA Suite 10g (ESB) naar OSB 11g, 65% slechtereresponsetijd
  • Na een upgrade van SOA Suite 10g (ESB) naar OSB 11g, 65% slechtereresponsetijd
  • Cache – spreekuit: kasjeKastjesBrowser: Client (browser, cookie or Java Script memory; HTML 5 offers persistent, cross session local db like storage)App Server : Edge (WebServer)JVM (and cluster)Cross cluster shared cachedb or memory gridDatabase (not requery at least)
  • http://thecleancoder.blogspot.com/2010/08/why-clojure.htmlWhat this means is that our computers can still get faster, but only if we put multiple CPUs on a chip.  This is why we've seen all these multi-core processors showing up.  And thatmeans that programs that need greater speed will have to be able to take advantage of the multiple cores.
  • Additional bar tendersNo improved performanceIn fact: some degradation(new) Bottleneck: coffee machinesSystem is I/O bound, increase CPU will only increase the ‘threading overhead’ and degrade performanceSame with more toilets: the washing basins become the new bottle neckSynchronization points
  • Compare ECT:Unload all containers, than start moving out (train?)Unload one, put on truck and start driving; then unload next one
  • Plaatje van printerPrint Job wordtnaar printer gestuurdWil je zandloper tot de printer klaar is met de klus?Of een melding ‘job has started’ en doorgaan met je werk
  • Do not do (synchronous) work in resources that are not ideally equipped/do that work in a suboptimal way
  • Copy data in PL/SQL (rather than bring from DB to Middletier, copy, send back again)
  • Transcript

    • 1. Verlichte Java Applicaties<br />Oracle Technology Daya – Enterprise Java Performance<br />
    • 2. Overview<br />What is performance?<br />Where is performance established?<br />Advanced tuning methods<br />ISYITF Method for Performance Improvement:<br />Do not do it …<br />Architecting Enterprise Java applications for improved performance<br />
    • 3. Performance Degradation<br />65 %<br />
    • 4. Performance Degradation<br />Response time<br />+ 65 %<br />
    • 5. Performance<br />Who determines in what way the performance<br />Expectations<br />Measure objectively<br />Business Owner<br />Business Objectives<br />Process Duration<br />Wait time<br />SLAs<br />What is start and what is end of action<br />Availability ≈ Performance<br />Disappearance Hourglass<br />Response time<br />Meaningful response<br />
    • 6. The Theater manager<br />
    • 7. Typical Layout of Enterprise Java applicatiONS<br />Performance ≈ Wait for Response<br />Web Browser<br />JEE Application Server<br />RDBMS<br />
    • 8. Performance contributors in Enterprise Java applicatiONS<br />Performance ≈ Wait for Response<br />Web Browser<br />Response = Wait + Processing<br />Wait = Network 1 + Response AppServer<br />1<br />JEE Application Server<br />Response = Wait + Processing<br />Wait = Network 2 + Response Database<br />2<br />RDBMS<br />Response = Processing<br />Processing = internal wait (I/O) + CPU<br />
    • 9. Advanced Tuning Methods<br />Use StringBuffer rather than plain String concatenation<br />Use SAX for XML parsing instead of DOM<br />Carefully select the collection class to use<br />optimize hashcode() in custom Map implementations<br />Use profiling tools to identify hotspots in the Java code<br />Remove Assertions from production code<br />Find optimal JVM switches through trial-and-error<br />Focus on GC, Heap size, thread pools<br />Pool resources and reuse objects rather than recreate<br />Leverage concurrency features in Java to<br />speed up time-to-completion through parallel execution<br />prevent underuse of CPU during I/O operations<br />Optimize algorithms for sorting, pattern matching, iteration, serialization, …<br />
    • 10. ISYITF Method for Performance improvement<br />The fastest way to perform a task:<br />DO NOT do it<br />
    • 11. Prevent unneeded processing<br /> if ( expensiveEvaluation & someFlag) { ...} <br /> if (someFlag && expensiveEvaluation) { ...} <br />
    • 12. Prevent unneeded processing<br />log.debug ( “Outcome step 2: ” + resultOfExpensiveProcessing );<br /> if (log.doDebug) log.debug ( “Outcome step 2: ” + resultOfExpensiveProcessing );<br />
    • 13. The shopping algorithm<br />
    • 14. The Shopping algorithm<br />shopForItem Item ( String itemName) {driveToShop; Item item = buyItemAtShop ( itemName);driveHomeFromShop; return item;}<br />
    • 15. Get this week’s groceries <br />getGroceries Item[] ( String[] shoppingList) { Item[] items = new Item[ shoppingList.length]; for (inti=0; i < shoppingList.length; i++) { items[i] = shopForItem (shoppingList[i]); } return items;}<br />
    • 16. ISYITF Method for Performance improvement<br />At All<br />At All<br />More often than required<br />DO NOT do it<br />
    • 17. Sweet memories<br />
    • 18. Stock management<br />
    • 19. Stock management<br />
    • 20. Do not do it…More often than required<br />If it has been produced before…<br />Reuse before re-produce!<br />If it has been shipped before…<br />Reuse instead of re-ship<br />… provided it is still fresh<br />Web Browser<br />JEE Application Server<br />RDBMS<br />
    • 21. Do not do it…More often than required<br />Save on network trips, context switches and tiers to cross<br />Save on ‘reproducing’ same results<br />Web Browser<br /><ul><li>JS data (memory)
    • 22. Cookies
    • 23. HTML 5 db</li></ul>Edge Cache<br />JEE Application Server<br />Cache<br />Cluster Fail-Over<br />(Session State)<br />Result Store<br />Write Behind<br />Client Result Cache<br />RDBMS<br />Result Cache<br />Materialized View<br />
    • 24. More performance requires parallel<br />
    • 25. More performance requires parallel<br />
    • 26. ISYITF Method for Performance improvement<br />DO NOT do it …<br />At All<br />More often than required<br />On your own<br />
    • 27. Moore’s law revised: cores law<br />
    • 28. Do not do it…On your own<br />Parallel means: multiple resources contributing to a task at the same time<br />Leverage multi-core CPU<br />Achieve scalability and performance with a Cluster<br />Introduce parallellism into your application<br />Java: Concurrency (ThreadPools), WorkManager<br />Database: parallel query and DML , dbms_parallel_execute, dbms_job, parallel table functions<br />Multi threading: on every tier and even across tiers<br />Engage compute grid: multi node processing unit<br />
    • 29. Balance resources to Prevent Clogging<br />
    • 30. Pancake Party<br />
    • 31. Better performing Pancake Party<br />
    • 32. Pipelined Pancake Party: best performance<br />
    • 33. Pipelined Pancake Party<br />Parallel Pipelined: multiple different resources working on different components of the task in [potentially] different tiers<br />From batch processing to unit processing => pass the unit on for further processing as soon as part of the task is done – to leverage resources (across tiers) in parallel<br />Instead of baking the entire stack first and only then eating it…<br />… start eating as soon as the first one is done<br />Even the last guest ends earlier than without pipelining provided he eats more than one pancake<br />(he eats his first pancake when it is done, not when the stack is done)<br />The first eater is done much sooner <br />first rows/all rows ≈ first pan cake/all pan cakes<br />
    • 34. Pipelining across the tiers<br />Database: <br />Pipelined Table Functions<br />Pipes and Queues<br />Middle tier:<br />Multiple threads<br />Queues (JMS)<br />Client tier:<br />AJAX “channels”<br />WebSockets<br />Web Browser<br />RDBMS<br />
    • 35. The pinnacle of un-performance<br />
    • 36. Fire and forget<br />
    • 37. ISYITF Method for Performance improvement<br />DO NOT do it …<br />At All<br />More often than required<br />On your own<br />immediately<br />
    • 38. fire and forget in the real world<br />
    • 39. Do not do it…Immediately (or synchronously)<br />Submit information, file a complaint or request, start a process, trigger interaction<br />No immediate response is required!<br />Asynchronous<br />Start batch job (db) or worker-thread (java)<br />Or fire event<br />Write behind (from grid) (NO SQL)<br />DML Error log<br />
    • 40. Do not do it…in BATCH (un-immediately)<br />Batch jobs can put peak load on a system – choking on line applications<br />Monthly reporting, quarterly prolongation, yearly calculation, <br />Batch jobs are increasingly unwanted in 24/7<br />When is the “nightly” batch window?<br />Data not current (enough) by today’s standards: “batch has not run yet”<br />Batch jobs used to be desirable or needed as a result of technical limitations – that may not apply anymore<br />Continuous, near real-time operations – leveraging events, decoupling and integration architectures – are a serious alternative<br />
    • 41. Don’t call us … we’ll call you<br />
    • 42. ISYITF Method for Performance improvement<br />DO NOT do it …<br />At All<br />More often than required<br />On your own<br />immediately<br />As per request<br />
    • 43. Do not do it…As per request<br />Push has two key advantages over poll<br />Most up to date information<br />Reduction in network traffic and load on server<br />Push is available in several flavors<br />Middleware to Browser: comet, ADF Active Data Service, WebLogic Server HTTP Channels, long poll, WebSockets in HTML 5<br />Database to Middleware: JMS/AQ, Database Query Result Change Notification, Table Triggers, utl_http push to servlet<br />“piggy backing” – adding subscribed-to information in regular requests<br />Event driven architecture is based on push (of events) to mediating event handling infrastructure<br />
    • 44. Bite off more than you can Have to chew<br />
    • 45. ISYITF Method for Performance improvement<br />DO NOT do it …<br />At All<br />More often than required<br />On your own<br />immediately<br />As per request<br />In too big or too small steps<br />
    • 46. Do not do it…In too big steps<br />Performance perception is often: time until page is displayed and accessible (hourglass disappears)<br />Web pages frequently contain much more than is initially visible or even required<br />Tree nodes, inactive tabs, invisible popups, unopened dropdown lists <br />Performance perception can be enhanced by not initially loading what is not required<br />Use AJAX based post-loading to (lazy-)fetch content in subsequent, background round-trips<br />/*+ First Rows */ vs. /*+ All Rows */<br />
    • 47. Do not do it…In too big or too small steps<br />Every network round-trip and context-switch adds overhead<br />Compare dialing the operator for every digit in the telephone number you want to learn about<br />Bundling up information to reduce the number of round trips can be advantageous for performance<br />Bring all items from the shop in one round trip<br />Leverage collections and types, XML or JSON to retrieve complex, structured object graphs from DB<br />Zipping up multiple web resources in single archive<br />Mashing up icons or images into a single big picture <br />Piggy-back information onto requests<br />
    • 48. The hard way<br />
    • 49. a convoluted way<br />
    • 50. ISYITF Method for Performance improvement<br />DO NOT do it …<br />At All<br />More often than required<br />On your own<br />immediately<br />As per request<br />In too big or too small steps<br />In a convoluted way<br />
    • 51. Do not do it…In a convoluted way<br />Pragmatism can overcome theoretical purity (or old dogs’ tricks)<br />With good reason and well documented<br />Have client side Java Script directly access Google Maps – by-passing the application server<br />Have client directly access Database services<br />Use RESTful (JSON, CSV) rather than WS* and XML between browser client and application server<br />Use POJOs (Entities) throughout the application, from JPA to Web Tier – rather than copying/transferring<br />When that suffices, use simple substring i/o parsing big xml in DOM<br />Pass plain CSV/JSON/XML from DB through Java middle tier to Client when that is appropriate<br />
    • 52. Bottleneck / Critical chain<br />
    • 53. ISYITF Method for Performance improvement<br />DO NOT do it …<br />At All<br />More often than required<br />On your own<br />immediately<br />As per request<br />In too big or too small steps<br />In a convoluted way<br />In A suboptimal place<br />
    • 54. Bottleneck / Critical chain<br />Make sure that the bottleneck resource in your enterprise application is not used (at peak times) for work that is not critical or that can be outsourced<br />Use auxiliary resources – outside critical chain<br />Engage specialized servers, optimized for specific tasks<br />Manage resources in a strict manner<br />Resource manager (DB) or Work manager (WLS)<br />
    • 55. Do not do it… LIVE Event processingIn a suboptimal place<br />The league of real time events<br />Continuous stream of a multitude of tiny events with hardly any payload, to analyze & aggregate<br />Sent from physical sensors (temperature, pressure, RFID, security gates), process sensors, Twitter, manufacturing equipment, database triggers, web servers, ESBs, stock trade tickers, sport statistics, RSS, network switches, …<br />
    • 56. Do not do it… HTML RenderingIn a suboptimal place<br />(X)HTML is not very compact<br />Information density of HTML is very low<br />DHTML, JavaScript &AJAX allow for<br />Dynamic HTMLrendering in browser<br />Dynamic, PartialPage Refresh<br />Most HTML presentedby application is pre-defined<br />Dynamic data contentfetched from RDBMSor other services issmall fraction<br />Web Browser<br />JEE Application Server<br />RDBMS<br />
    • 57. Do not do it…In a suboptimal place<br />Do not perform a task in a resource that is not ideally suited for that task<br />If it directly contributes to overall performance<br />
    • 58. Do not do it…In a suboptimal place<br />Leverage database for what it’s good at<br />Data Integrity – Primary Key /Unique Key /Foreign Key<br />Aggregation<br />Sorting<br />Data Rule enforcement<br />Bulk DML and Copy data<br />Analytical Functions, Model clause, Rollup<br />Specialized engines for<br />Imaging and Document Processing<br />Match and Search<br />Speech Recognition<br />Cryptography<br />3D <br />….<br />
    • 59. ISYITF Method for Performance improvement<br />DO NOT do it …<br />At All<br />More often than required<br />On your own<br />immediately<br />As per request<br />In too big or too small steps<br />In a convoluted way<br />In A suboptimal place<br />
    • 60. Architect For Performance<br />Web Browser<br />JEE Application Server<br />RDBMS<br />
    • 61. Architect(ure) for performance<br />Services ( Google Maps, Translation, Conversion, Data Feeds<br /><ul><li>JS data (memory)
    • 62. Cookies
    • 63. HTML 5 local db</li></ul>Web Browser<br />HTML rendering<br />Validation, Calculation, Parsing<br />“Processing” (image, cryption, compression, SETI)<br />Post load<br />(AJAX)<br />piggy-back<br />Fire&Forget<br />by-pass<br />JEE Application Server<br />
    • 64. Architect(ure) for performance<br />Services ( Google Maps, Translation, Conversion, Data Feeds<br /><ul><li>JS data (memory)
    • 65. Cookies
    • 66. HTML 5 local db</li></ul>Web Browser<br />HTML rendering<br />Validation, Calculation, Parsing<br />“Processing” (image, cryption, compression, SETI)<br />Post load<br />(AJAX)<br />piggy-back<br />push<br />Fire&Forget<br />by-pass<br />Edge Cache<br />Search& Match<br />Load balancer<br />Sticky ip sessions, Throttling<br />CEP<br />Cache<br />CMS<br />JEE AppServerNode<br />JEE AppServerNode<br />Node<br />Cluster Fail-Over<br />(Session State)<br />Result Store<br />Write Behind<br />Compute<br />Grid<br />WorkManager<br />Parallel Threads<br />JMS<br />Crypto<br />Image<br />Print<br />Server<br />
    • 67. Architect(ure) for performance<br />by-pass<br />Edge Cache<br />Search& Match<br />Load balancer<br />Sticky ip sessions, Throttling<br />CEP<br />CEP<br />Cache<br />CMS<br />CMS<br />JEE AppServerNode<br />JEE AppServerNode<br />Node<br />Cluster Fail-Over<br />(Session State)<br />Result Store<br />Write Behind<br />Compute<br />Grid<br />Compute<br />Grid<br />WorkManager<br />Parallel Threads<br />JMS<br />Crypto<br />Crypto<br />Image<br />Image<br />Print<br />Server<br />Print<br />Server<br />push<br />Client Result Cache<br />Postload<br />Fire&Forget<br />AQ/JMS<br />HTTP Push<br />DB QRCN<br />RDBMS<br />REST API<br />Result Cache<br />Aggregation<br />Filter & Sort<br />Data Integrity<br />Bulk DML<br />Resource Mgt<br />Jobs<br />Pipelining<br />Parallel Processing<br />Materialized View<br />CBO<br />
    • 68. Services ( Google Maps, Translation, Conversion, Data Feeds<br /><ul><li>JS data (memory)
    • 69. Cookies
    • 70. HTML 5 local db</li></ul>Web Browser<br />HTML rendering<br />Validation, Calculation, Parsing<br />“Processing” (image, cryption, compression, SETI)<br />Post load<br />(AJAX)<br />push<br />piggy-back<br />Fire&Forget<br />by-pass<br />Edge Cache<br />Load balancer<br />Sticky ip sessions, Throttling<br />CEP<br />Cache<br />CMS<br />JEE AppServerNode<br />JEE AppServerNode<br />Node<br />Cluster Fail-Over<br />(Session State)<br />Result Store<br />Write Behind<br />Compute<br />Grid<br />WorkManager<br />Parallel Threads<br />JMS<br />Crypto<br />Image<br />Print<br />Server<br />push<br />Client Result Cache<br />Postload<br />Fire&Forget<br />AQ/JMS<br />HTTP Push<br />DB QRCN<br />RDBMS<br />REST API<br />Result Cache<br />Aggregation<br />Filter & Sort<br />Data Integrity<br />Bulk DML<br />Resource Mgt<br />Jobs<br />Pipelining<br />Parallel Processing<br />Materialized View<br />CBO<br />
    • 71. Summary<br />Performance requirements are derived from measurable and meaningful business objectives<br />Unavailability equals Zero Performance<br />Treat Performance and Availability elements in the same equation<br />Performance should [also] be addressed in a top-down approach, across all tiers and constituent parts<br />Some ISYITF guidelines:<br />Do not do it … [AT ALL | MORE OFTEN THAN REQUIRED | ON YOUR OWN | IMMEDIATELY | AS PER REQUEST | IN TOO BIG OR TOO SMALL STEPS | IN A CONVOLUTED WAY | IN A SUBOPTIMAL PLACE ]<br />

    ×