29

Load testing and performance tracing

Embed Size (px)

Citation preview

Page 1: Load testing and performance tracing
Page 2: Load testing and performance tracing

Load testing and performance tracing

Page 3: Load testing and performance tracing

My Name is Hans Höchtl

Technical director @ Onedrop Solutions

PHP, Java, Ruby Developer

Participation in TYPO3 Solr

Page 4: Load testing and performance tracing

Load testing

Determining the maximum operating capacity of an application.

Page 5: Load testing and performance tracing

Why?

- Properly scale your system

- Analyze QoS performance

- Identify bottlenecks

- Check reliability

- Verify SLA

Page 6: Load testing and performance tracing

How?

- Have a lot of friends

- Have a lot of employees

- Pay people

- Use proper software solution

Page 7: Load testing and performance tracing

Apache JMeter

- Open source java tool (therefore platform idependent)

- Can analyze any kind of web application (or native software)

- Easy configurable tests and graphs

- Supports external data sources for serving test data

- Scales

Page 8: Load testing and performance tracing

Let’s look into test plans

Page 9: Load testing and performance tracing

JMeter master-slave

- Uses RMI

- Use the same network subnet or a proxy

- Use SSH portforwarding

- If you configure live results, network bandwidth will be heavy

Page 10: Load testing and performance tracing

Blazemeter

- SaaS solution to run JMeter tests at scale

- Can use AWS, Google Cloud, your own machines (reduces configuration overhead for RMI)

- Integrates with CI tools => measure performance increase/decrease before a release

Page 11: Load testing and performance tracing

Blazemeter

- SaaS solution to run JMeter tests at scale

- Can use AWS, Google Cloud, your own machines (reduces configuration overhead for RMI)

- Integrates with CI tools => measure performance increase/decrease before a release

Page 12: Load testing and performance tracing

Oh btw, don’t use it for DDoS

Page 13: Load testing and performance tracing

Now we know how our system performs.

But where to start optimizing?

Page 14: Load testing and performance tracing

Profiling

Measure the memory usage, complexity of a program, the usage of particular instructions and the frequency and duration of function calls.

Page 15: Load testing and performance tracing

Performance lifecycle

Profiling

Changes

Load Testing

Page 16: Load testing and performance tracing

Application stack

CPU

Memory

HarddiskNetwork

OSWebserver

Script InterpreterDatabase

PHP framework

Your application

Page 17: Load testing and performance tracing

Profiling PHP applications

- Free tools

- Xdebug + Webgrind

- XHProf + XHGUI

- Commercial tools

- Newrelic

- Blackfire.IO

Page 18: Load testing and performance tracing

Setting up XHProf and profiling an application

Page 19: Load testing and performance tracing

Analyzing the callgraph

- Look at the excl. wall time

- Identify database heavy components

- Check call path for IO operations

Page 20: Load testing and performance tracing

Optimizing your application

- Use „more“ hardware

- SSD instead of HDD

- Proper caching

- Caching backend (Redis)

- Cacheable output?

- OpCode Cache + APCu!!!

- Reduce/optimize queries

Page 21: Load testing and performance tracing

Optimizing your software

- Beware of swap

- Update/Upgrade

- Optimize database

- Use alternatives (Nginx, MariaDB, HipHop)

Page 22: Load testing and performance tracing

http://wiki.dreamhost.com/Web_Server_Performance_Comparison

Page 23: Load testing and performance tracing

https://entwickler.de/online/php-5-6-und-noch-mehr-performance-139204.html

Page 24: Load testing and performance tracing

https://www.zend.com/en/resources/php7_infographic

Page 25: Load testing and performance tracing

https://blog.mariadb.org/performance-evaluation-of-mariadb-10-1-and-mysql-5-7-4-labs-tplc/

Page 26: Load testing and performance tracing

Optimizing your database

- Inform yourself (book, webinar, etc.)

- Use the percona toolkit

- Mount your database in memory (just kidding)

- If on a different host, check latency

- Persistent connection?

Page 27: Load testing and performance tracing

Frontend performance

- pagespeed

- defer loading

- image optimization

- concat, compress, etc.

- http://www.smashingmagazine.com/2014/09/08/improving-smashing-magazine-performance-case-study/

Page 28: Load testing and performance tracing

- https://blog.engineyard.com/2014/profiling-with-xhprof-xhgui-part-1

- https://blackfire.io/

- http://www.oreilly.de/catalog/hpmysqlger/

- https://www.percona.com/software/percona-toolkit

Page 29: Load testing and performance tracing

Thank you

Mail: [email protected] or [email protected]: @hhoechtlBlog: http://blog.1drop.de