SlideShare a Scribd company logo
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE1
PHP#Meetup#Melbourne,#Australia#
April#2014#
Harald#Zeitlhofer#
@HZeitlhofer#
PHP#Applica=on#Performance#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE2
• Technology#Strategist#at#Dynatrace#
• Database#and#Web#Development#
• PHP#for#more#than#15#years#
• Love#to#discover#new#things#
Harald#Zeitlhofer#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE3
I’m#from#Austria#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE4
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE5
But#you#probably#
know#that...#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE6
And#
for#
sure#
you##
know#
that##
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE7
Also#from#Austria#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE8
You#might#have#heard#of...#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE9
Applica=on#Performance#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE10
Failures happen!!
Nobody likes it when …
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE11
Unless you work for
Google or Microsoft !
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE12
… or this …
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE13
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE14
.. as it leads to this …
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE15
The#“War#Room”#
#
Facebook#–#December#2012#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE16
… and potentially to this …
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE17
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE18
And this isn’t helping either …
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE19
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE20
Yes, failures happen!!
but we can identify
and/or avoid them !
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE21
but#where#should#we#start?#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE22
and#when#???#
?
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE23
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE24
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE25
some%use%cases%
and%best%prac/ces%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE26
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE27
Not#following#Web#Performance#Best#Prac=ces# 282!$Objects#
on#that#page#9.68MB#Page#Size#
8.8s$Page#Load#
Time#
Most#objects#are#images#
delivered#from#the##
main#domain#
Very#long#connect#=me#
(1.8s)#to#the#CDN#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE28
Mobile#Web#Site:#This#SHOULD#NOT#happen!#
434$Resources$in#total#on#that#page:#
230#JPEGs,#75#PNGs,#50#GIFs,#…#
Total#size#of#~#20MB$
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE29
cached#content#
s=ll#creates#roundtrips#!#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE30
use%proper%caching%
%
pack%JS,%CSS%files%
%
use%sprites%for%images%
%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE31
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE32
frustrated#users#
slow#user#ac=on#
response#=me#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE33
errors#in#PHP#execu=on#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE34
less#library#caused#
performance##
hotspot#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE35
know%your%code%
%
know%your%%
external%libraries%
%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE36
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE37
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE38
/katgrp/browse#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE39
/katgrp/get/$/1626#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE40
/cave/browse/gis/$/katgrp/1626#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE41
/cave/browse/gis/$/katgrp/1626#–#applica=on#context#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE42
Sessions#in#PHP#
•  session_start()#locks#the#file#where#session#data#are#stored#
•  Released#when#script#ends#
•  Use#session_write_close()#to#unlock#the#file#before#execu=ng#slower#code#
•  Or#create#your#own##
save#handler#with##
session_set_save_handler()#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE43
Looks#bener#now…#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE44
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE45
performance#hotspot#
/en/externalprice/#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE46
response#=me##
hotspot#PHP#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE47
session#data#locking#
response#=me#hotspot:#
usleep();%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE48
be%careful%with%locking%
%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE49
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE50
Locking#problem#solved,#but#…#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE51
/katgrp/browse#server#side#execu=on#
=me#to#check##
the#database#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE52
From#the#DB#perspec=ve#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE53
Here#we#go:#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE54
N+1#Queries#
Metrics:##
##SQL#Execu=ons#/#Request#
##of#“same”#SQL#Execu=ons#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE55
mind%the%database%!!!%
%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE56
anything#else#we#can#do?#
what#about##
3rd#party#content?#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE57
3rd#party#content#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE58
3rd#party#content#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE59
watch%external%services%
%
be%aware%there%are%
services%you%%
can't%control%
%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE60
to#summarize#that#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE61
PHP#Applica=on#Performance#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE62
PHP#OpCache#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE63
PHP#OpCache#disabled#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE64
PHP#OpCache#enabled#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE65
huge#number#of#
sta=c#resources#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE66
Web#Request#handling#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE67
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE68
Web#Request#handling#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE69
Transac=on#flow#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE70
Nginx#FastCGI#cache#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE71
Nginx#FastCGI#cache#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE72
Full#page#/#data#cache#with#Nginx#and#Memcached#
<?php
...
function __construct () {
$this->c = new Memcached();
$this->c->addServer('localhost',11211);
}
function setCache ($key, $content) {
$this->c->set($key, $content);
}
...
$this->setCache($_SERVER['REQUEST_URI'], $this->renderPage());
...
$this->setCache('/data/news/getlist', $this->getNewsList());
...
?>
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE73
• ngx_hnp_memcached_module#
Full#page#/#data#cache#with#Nginx#and#Memcached#
server {
location / {
set $memcached_key "$uri";
memcached_pass localhost:11211;
error_page 404 502 504 = @fallback;
}
location @fallback {
proxy_pass http://backend;
}
}
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE74
PHP,#5k#requests,#concurrency#100#
0#
1#
2#
3#
4#
5#
6#
7#
8#
Apache+PHP# Nginx+PHP# Nginx+Memcached#
<?php
echo "Hello World";
?>
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE75
use%right%server%tools%
%
configure%properly%
%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE76
But still,
failures happen!!
make sure to identify
them as soon as
possible
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE77
EndtTotEnd#Applica=on#Monitoring#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE78
monitor%all%transac/ons%in%all%channels%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE79
User#Experience#Management#
locate%regional%performance%issues%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE80
monitor%your%infrastructure%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE81
process%monitoring%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE82
iden/fy%response%/me%hotspots%in%the%backend%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE83 drill%down%to%find%the%root%cause%
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE84
Applica=on#Performance#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE85
Performance#Tools#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE86
• Load#Generator#(Apache#Benchmark,#JMeter)#
• Firebug,#Google#Developer#Tools#
Dynatrace#Ajax#Edi=on#
• Google#PageSpeed#
• Dynatrace#Free#Trial#
•  Free#trial#license#for#30#days#
•  Free#for#developers#on#local#machine#
My#favorites#
hnp://bit.ly/dnrial#
COMPANY CONFIDENTIAL – DO NOT DISTRIBUTE87
www.dynatrace.com#
Thank#you#!!!#
Harald%Zeitlhofer%
Senior#Technology#Strategist#
#HZeitlhofer#
harald.zeitlhofer@dynatrace.com#
hnp://blog.dyntrace.com#

More Related Content

TXT
Appendix
PDF
Les leçons à puiser du ramadan
TXT
Readme
PDF
Fashion Marketing Project: "Flash Your Style"
TXT
REAL KALKI AVATAR
PDF
Home-Build Concierge Printed Brochure
PDF
How to Evaluate WordPress Plugins Before Activating
PDF
Ks Iconic
Appendix
Les leçons à puiser du ramadan
Readme
Fashion Marketing Project: "Flash Your Style"
REAL KALKI AVATAR
Home-Build Concierge Printed Brochure
How to Evaluate WordPress Plugins Before Activating
Ks Iconic

Viewers also liked (20)

PPT
Les réseaux mobiles et sans fils et les nouvelles perspectives du marketing d...
DOCX
Perbedaan Tampilan Microsoft Word 2003, 2007 dan 2010
PDF
The missing link in your network - Empower your people through open interact...
PDF
6 gkh internet
PPTX
Homecoming 2014 Final
PPTX
Elemen Perubahan Kurikulum rev
PPTX
kacxis sveti C I U
DOCX
Assure model day 1
PPT
Customer journey mcb 2015
PDF
.Sla 3
PPTX
Means of transportation
PPTX
PPTX
Isee 2016 early morning session - hk
PDF
Performance optimisation - scaling a hobby project to serious business
PPTX
WordPress Workshop
DOCX
Jardas
DOCX
Assure model day 3
PPTX
Google page ranking
PPTX
SchoolCTF 2012 - Rings
PDF
Инвестиционная стратегия (Москва)
Les réseaux mobiles et sans fils et les nouvelles perspectives du marketing d...
Perbedaan Tampilan Microsoft Word 2003, 2007 dan 2010
The missing link in your network - Empower your people through open interact...
6 gkh internet
Homecoming 2014 Final
Elemen Perubahan Kurikulum rev
kacxis sveti C I U
Assure model day 1
Customer journey mcb 2015
.Sla 3
Means of transportation
Isee 2016 early morning session - hk
Performance optimisation - scaling a hobby project to serious business
WordPress Workshop
Jardas
Assure model day 3
Google page ranking
SchoolCTF 2012 - Rings
Инвестиционная стратегия (Москва)
Ad

Similar to PHP application performance (20)

PDF
A Playbook for Achieving Product-Market Fit by Dan Olsen at Lean Startup Conf...
PDF
The 7 Metrics of Highly Effective Marketers by Dan Olsen
PDF
Content Strategists: Use SEO to achieve your content goals #ConfabEU
PDF
Conquering International Search Markets: #InternationalSEO at #SMConnect
PDF
Paul Maxin - Talent Acquisition through Digital Channels at Unilever
PDF
Taking your International SEO to the next level at #SMXParis
PDF
HR Trend Institute Trends November 2014
PDF
AWS Managed Services - For Regulated Companies
PDF
How to Leverage Content Curation in SEO #BrightonSEO
PDF
What Makes your SEO Fail (and how to fix it) #BrightonSEO
PPTX
devopsdays Kiel 2018 - Can the AI hype & ML algorithms harm your devops initi...
PDF
PWA SEO: Optimizing for the Future of the Web
PDF
PHP App Performance / Sydney PHP
PDF
How To Get More Leads For Your Business With Videos
PDF
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
PDF
On the Value of User Preferences in Search-Based Software Engineering:
PDF
SEO for PWAs #PubCon
PDF
PHP Application Performance
PPTX
ARTES 20 IAP Success Story - Vecmap
PDF
Winning in a 
Mobile Search World #SearchStarsSE
A Playbook for Achieving Product-Market Fit by Dan Olsen at Lean Startup Conf...
The 7 Metrics of Highly Effective Marketers by Dan Olsen
Content Strategists: Use SEO to achieve your content goals #ConfabEU
Conquering International Search Markets: #InternationalSEO at #SMConnect
Paul Maxin - Talent Acquisition through Digital Channels at Unilever
Taking your International SEO to the next level at #SMXParis
HR Trend Institute Trends November 2014
AWS Managed Services - For Regulated Companies
How to Leverage Content Curation in SEO #BrightonSEO
What Makes your SEO Fail (and how to fix it) #BrightonSEO
devopsdays Kiel 2018 - Can the AI hype & ML algorithms harm your devops initi...
PWA SEO: Optimizing for the Future of the Web
PHP App Performance / Sydney PHP
How To Get More Leads For Your Business With Videos
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
On the Value of User Preferences in Search-Based Software Engineering:
SEO for PWAs #PubCon
PHP Application Performance
ARTES 20 IAP Success Story - Vecmap
Winning in a 
Mobile Search World #SearchStarsSE
Ad

More from Harald Zeitlhofer (13)

PDF
Slow Database in your PHP stack? Don't blame the DBA!
PDF
Scaling PHP web apps
PDF
PHP and databases
PPTX
Boost your website by running PHP on Nginx
PDF
Running PHP on Nginx
PDF
Improve Magento Performance
PPTX
PHP conference Berlin 2015: running PHP on Nginx
PDF
Running PHP on Nginx / PHP wgtn
PDF
Running PHP on nginx
PDF
Running php on nginx
PDF
Nginx performance monitoring with Dynatrace
PDF
Nginx, PHP, Apache and Spelix
PDF
Nginx, PHP and Node.js
Slow Database in your PHP stack? Don't blame the DBA!
Scaling PHP web apps
PHP and databases
Boost your website by running PHP on Nginx
Running PHP on Nginx
Improve Magento Performance
PHP conference Berlin 2015: running PHP on Nginx
Running PHP on Nginx / PHP wgtn
Running PHP on nginx
Running php on nginx
Nginx performance monitoring with Dynatrace
Nginx, PHP, Apache and Spelix
Nginx, PHP and Node.js

Recently uploaded (20)

PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
cuic standard and advanced reporting.pdf
PPT
Teaching material agriculture food technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Big Data Technologies - Introduction.pptx
Unlocking AI with Model Context Protocol (MCP)
cuic standard and advanced reporting.pdf
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectral efficient network and resource selection model in 5G networks
Programs and apps: productivity, graphics, security and other tools
Advanced methodologies resolving dimensionality complications for autism neur...
Diabetes mellitus diagnosis method based random forest with bat algorithm
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Network Security Unit 5.pdf for BCA BBA.
Review of recent advances in non-invasive hemoglobin estimation
MIND Revenue Release Quarter 2 2025 Press Release
sap open course for s4hana steps from ECC to s4
Per capita expenditure prediction using model stacking based on satellite ima...
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Weekly Chronicles - August'25-Week II
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

PHP application performance