Slide 1

Slide 1 text

DISCOVERING & SOLVING PERFORMANCE ISSUES

Slide 2

Slide 2 text

Quick overview, rather than detailed look What works for me, might not work for you Introduction to some tools Opinionated guide of practices WHAT TO EXPECT?

Slide 3

Slide 3 text

DENIS BRUMANN SensioLabs
 Berlin, Germany
 Developer @dbrumann
 [email protected]

Slide 4

Slide 4 text

SYMFONY WEB PROFILER

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

not shown, but also containing the web-profiler:
 symfony/debug-pack

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

{{ render(controller('App\\Controller\\GroupController::listAction')) }} {{ render(controller('App\\Controller\\EventController::listAction')) }}

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

How to Use the Profiler in a Functional Test https://symfony.com/doc/current/testing/profiling.html

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

It can be used to simulate a heavy load on a server, group of servers, network or object to test its strength or to analyze overall performance under different load types. https://jmeter.apache.org/

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

CAPACITY TEST
 Determine how many users and/or transactions a given system
 will support and still meet performance goals. LOAD TEST
 Verify application behavior under normal and peak load conditions. STRESS TEST
 Determine or validate an application’s behavior when pushed
 beyond normal or peak load conditions.

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

https://msdn.microsoft.com/en-us/library/bb924375.aspx

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Decorate original ApiClient with PSR-6 Cache https://symfony.com/doc/current/service_container/service_decoration.html

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

TYPICAL PROBLEM GROUPS I/O Wait CPU-Usage Memory-Usage Network-Latency SQL-Queries

Slide 38

Slide 38 text

HOW TO IMPROVE PERFORMANCE?

Slide 39

Slide 39 text

PHP 7

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

DOCTRINE

Slide 44

Slide 44 text

http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/improving-performance.html METADATA & QUERY CACHES it is strongly discouraged to use Doctrine without a Metadata and Query cache (preferably with APC or Memcache as the cache driver). ALTERNATIVE RESULT FORMATS Make effective use of the available alternative query result formats like nested array graphs or pure scalar results, especially in scenarios where data is loaded for read-only purposes.

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

APPLICATION CACHE

Slide 48

Slide 48 text

HTTP CACHE & ESI

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

DISCOVERING PERFORMANCE PROBLEMS Overall performance & scalability? Unspecified performance issue on a specific page? Worker jobs & CLI tasks? Load & capacity tests using JMeter During development: Web Profiler In depth analysis: Blackfire Blackfire

Slide 51

Slide 51 text

GENERAL TIPS Measure first, then change Make changes in small increments Search for causes, not symptoms Verify assumptions & results with real data Revisit old assumptions

Slide 52

Slide 52 text

THANK YOU