1 of 27

Slide Notes

DownloadGo Live

Performance Tunning

Published on Nov 25, 2015

No Description

PRESENTATION OUTLINE

Performance tuning

Building a way to success
Photo by yonsterz

Click to Edit

Click to add more text here
On May we have been speaking about Docker...

...My son, Martín, soon have learned to squeeze it!!!

https://lnkd.in/e6cBGKP

Let's see what happens with "Performance Tunning"

Performance:
"Manner or quality of functioning"

Photo by sickmouthy

Why?

Performance Influences Revenue

Know your context

- Architecture

- Development Team

- Budget

What are your performance expectations?

WHAT ARE YOUR PERFORMANCE EXPECTATIONS?
- PDP load times
- Time to first byte
- Search results
- Page views per second
- Concurrent cockpit users
- AddToCart times
- Orders per minute

Old methodology

  • Pre Go-Live / Millestones
  • Simulate real-world patterns
  • JMeter, multi-mechanize, SOASTA, Keynote, Blazemeter

PERFORMANCE TESTING
Photo by @Doug88888

Proper infrastructure

  • Application Data
  • Server Sizing
  • Server Configuration
  • Test Infrastructure

Techniques

  • Profiler
  • Availability Monitor
  • Server Monitor
  • Appplication Performance Management
http://blogs.gartner.com/jonah-kowall/2014/02/14/application-monitoring-is-...

1. “Profiling is achieved by instrumenting either the program source doe or its binary executable form using a tool called a profiler (or code profiler)”

2. Availability monitoring is inexpensive, effective in catching major issues, and should be the staple of any monitoring initiative.

3. Server monitoring tools do more than monitor the server and OS components, but also handle the collection of data from instances of applications on the OS instances. The data collected includes metrics and often times log data which shows major issues in application availability or health.

4. Gartner defines application performance monitoring (APM) as one or more software and hardware components that facilitate monitoring to meet five main functional dimensions: end-user experience monitoring (EUM), runtime application architecture discovery modeling and display, user-defined transaction profiling, component deep-dive monitoring in application context, and analytics.
Photo by deletem3

WHEN IN DOUBT KICK ME OUT!
What's our capacity like during peak period?
- Let's monitor the application to find out!

Monitoring with JMX

MONITOR SYSTEM RESOURCES IN REAL TIME!

- Thread pools
- JALO sessions
- CPU and memory
- DB connection pool
- Cache statistics
- Active connections
- Garbage Collection
- Monitoring Cache Regions with hAC
- Identify ineffective caching
- Region cache for types, entities (JALO items) and queries.
-Hit/Miss Ratio, Misses/Eviction/Invalidations

Garbage Collection

JVM Heap


http://blogs.gartner.com/jonah-kowall/2013/11/12/unified-monitoring-note-pr...

GO DEEP INSIDE
“Profiling is achieved by instrumenting either the program source doe or its binary executable form using a tool called a profiler (or code profiler)”

Code Profiling
- Thread dumps – use hAC or jstack (command line)
- Most frequently called method?
- Code profiler – e.g. VisualVM
- Method with longest duration?
- Method using highest CPU time?

DB Query Profiling
- Identify frequently executed queries or slow queries.
- Log file is generated and
can be downloaded.
- Enable tracing to include
the stack trace for every
logged statement.

Browser Profiling

- Normally app server only accounts for less than 1/3 of perceived load time!
- The rest is up to the browser!
- Profile document load using supported browser profilers.
- Profile page load using ySlow browser plugin.

https://en.wikipedia.org/wiki/Profiling_(computer_programming)

THE WINNER OPTION!
"The only difference of APM profilers from “other” profilers is that they are highly optimized. Many of them will work in production because they will try to reduce the amount of data being collected for your application in order to optimize performance. So, what APM companies are really trying to say is that their profilers are optimized to differentiate such profilers from the sort of heavy-weight profilers that can never be used in production. To the extent where such tools should be treated as(almost) non-profiling tools"

"Yesterday, customers experienced slow response times!"

- 3rd Party Code
- Search Index
- Client Side
-Background Jobs
- My Code
- Browser Version
- Webserver
- DB
- CPU
- Power Interacting Systems
- Disk IO
- JavaScript
- Session Size
- Garbage Collection
- External Services
- Webservice Calls
- Memory
- Session Timeout
- Cache Strategy
- Firewall
- Loadbalancing
- Network IO
- Bug
- System Configuration
- Their Code
- Cache Size
- Missing Index
- JDBC Driver
- JVM Options
-Hardware Fault
- Java Memory
- Generation Sizing
- Third Party Content


http://www.gartner.com/it-glossary/application-performance-monitoring-apm

http://blogs.gartner.com/jonah-kowall/2014/02/14/application-monitoring-is-...

https://blog.appdynamics.com/apm/newbie-guide-apm/TH

PUBLIC ENEMIES

COMMON MISTAKES

Database Indexing

ORM Cartesian Product

Caching

  • Entity cache
  • Query cache
  • DTO cache
  • Fragment Cache
  • Varnish !!!!
How can I reduce the CPU time used when rendering web pages?
- Cache DTOs to avoid expensive conversion but use different time to live values so that data is kept fresh

BEST IMPROVEMENT:
FROM 3 TO 13 PI PER SEC PER CORE


Size the caches correctly to avoid OOM Exceptions and memory leak symptoms

Don’t cache models! They are single threaded and memory will leak if models are used outside request context.

Caching

ImpEx (I)

  • Use a dedicated node to backend processes
  • Increase the number of threads
  • Avoid concurrent cronjobs
  • Review network latency
  • Create indexes for searchable header attributes

ImpEx (II)

  • Ensure unique attributes are really unique on data layer
  • Avoid sorted attributes when possible
  • Avoid combining headers
  • Avoid service layer mode

Catalog SYNC

  • Increase the number of threads.
  • Limit the languages to be sync.
  • Disable attributes not really needed within online catalog.
  • Avoid syncing some types
  • Avoid sorted relationships

Julio Arguello

solutions architect
My other son, Nicolás, soon realized what really performance tunning means:

- A must do.
- A continuous task.
- A feeling.
- A love.

¡GRACIES!

Performance tuning