make php fast again

25
Make PHP Fast Again PHP Performance Benchmarks

Upload: peter-kokot

Post on 03-Mar-2017

69 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Make PHP Fast Again

Make PHP Fast AgainPHP Performance Benchmarks

Page 2: Make PHP Fast Again

Peter Kokot github.com/petk

@peter_kokot

Page 3: Make PHP Fast Again

Intro

Page 4: Make PHP Fast Again

Why?

40% of users abandon a website that takes more than 3 seconds to load

Page 5: Make PHP Fast Again

General performance improvements guidelines● Server hardware● Minimize and optimize image file sizes● Gzip compression● Pre HTTP/2 minimize and combine JavaScript and CSS files● CDN● Asynchronous scripts loading

Page 6: Make PHP Fast Again

Synchronous vs. asynchronous loading

Page 7: Make PHP Fast Again
Page 8: Make PHP Fast Again
Page 9: Make PHP Fast Again

Blackfire is a Performance Management Solution. It can be used at any step of your application's lifecycle: during development, test, staging and production, to profile, test, debug and optimize its performance.

Page 10: Make PHP Fast Again
Page 11: Make PHP Fast Again
Page 12: Make PHP Fast Again

How to Achieve even more?

Page 13: Make PHP Fast Again

DisclaimerThe following stacks can behave differently on different hardware and configuration.

The following benchmarks are advised to be made on your own as well to get a better overview.

Page 14: Make PHP Fast Again

BenchmarksApache, Nginx, OpenLiteSpeed

Page 15: Make PHP Fast Again

Apache Benchmarking Tool● ab -c 100 -n 100000 -k http://localhost/● Intel® Core™ i7-2670QM CPU @ 2.20GHz × 8 with 16GB RAM

Page 16: Make PHP Fast Again

Static HTML File Benchmarksab -c 100 -n 100000 -k http://localhost/

Page 17: Make PHP Fast Again

PHP Benchmarksab -c 100 -n 100000 -k http://localhost/

Page 18: Make PHP Fast Again

PHP FPMTCP/IP Socket vs. Unix Domain Socketlisten = 127.0.0.1:9000 vs. listen = /run/php/php-fpm.sock

Page 19: Make PHP Fast Again

PHP-PM● PHP-PM is a process manager, supercharger and load balancer for PHP

applications.● Based on ReactPHP● Out of the box support for Symfony, Laravel, Zend Framework and Drupal

> github.com/php-pm/php-pm

Page 20: Make PHP Fast Again

PHP PM Benchmarks

Page 21: Make PHP Fast Again

Swoole is an event-driven, asynchronous & concurrent networking communication engine with higher performance written only in C for PHP. Swoole includes components for different purposes: TCP/UDP Server and Client, Task Worker, Database Connection Pooling, Millisecond Timer, Event, Async IO, Async Http/WebSocket Client, Async Redis Client, Async MySQL Client, and Async DNS Requiring.

> www.swoole.com

Page 22: Make PHP Fast Again

Swoole Benchmark

Page 23: Make PHP Fast Again

Combined Benchmarks

> github.com/petk/benchmarks

Page 24: Make PHP Fast Again

Next PHP Versions?● JIT - Just-In-Time compiling

● PHP 8 or PHP 7.2

Page 25: Make PHP Fast Again

Thank you!Questions welcome