accelarating php applications at intan sabah technology updates 2011
DESCRIPTION
"Accelarating PHP Applications" Presented at INTAN Sabah Technology Updates 2011TRANSCRIPT
![Page 1: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/1.jpg)
www.mimos.my © 2009 MIMOS Berhad. All Rights Reserved.
Accelerating PHPApplications
Errazudin Ishak
![Page 2: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/2.jpg)
Who Am I
PHP Center of Excellence
The Curious Case of Enterprise PHP
Summary
Agenda
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 3: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/3.jpg)
Senior engineer @ Mimos Berhad
Focuses on web application development, deployment, performance and stability.
2009 : foss.my , MyGOSSCON
2010 : Entp. PHP Techtalk, BarcampKL, PHP Meetup, MOSC2010, PHPNW UK, PHP20102010, MyGOSSCON
Me
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 4: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/4.jpg)
Agenda
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Who Am I
PHP Centre of Excellence
The Curious Case of Enterprise PHP
Summary
![Page 5: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/5.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
phpcoe.mimos.my
![Page 6: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/6.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
phpcoe.mimos.my
Top goals;
• increasing the maturity of the PHP application life cycle,
• showcasing the best practice of enterprise PHP development
• contributing to/supporting PHP open source projects
• supporting PHP user groups/communities
• organizing conferences/seminar
• developing localized training material
• forming and maintaining partnerships with the communities and developing professional services.
![Page 7: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/7.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Events : Enterprise PHP Tech talk
![Page 8: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/8.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Events : Facebook Developer Garage
![Page 9: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/9.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Events : PHP Malaysia Meetup
![Page 10: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/10.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Events : PHP Northwest, UK
![Page 11: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/11.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Accelerating PHP Application
http://goo.gl/EbTI
![Page 12: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/12.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
The News
![Page 13: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/13.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
iSDPIntelligent Service Delivery Platform
![Page 14: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/14.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
The struggle begins..
![Page 15: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/15.jpg)
Who Am I
PHP Center of Excellence
The Curious Case of Enterprise PHP (How actually we makes PHP apps fly)
Summary
Agenda
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 16: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/16.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Enterprise == ?
![Page 17: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/17.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
BA
Designer
Project Lead
DBA
Tester
PM
Sys. AdPHP Geek
TEAM
![Page 18: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/18.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAM
Requirement
•Customer need this …•User want that …•My boss add this …•My BA... more headache …
![Page 19: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/19.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
"Faster sites create happy users” – Google, April 9, 2010
http://www.flickr.com/photos/36230948@N05/
![Page 20: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/20.jpg)
• Planning
oRequirement Analysis
oDesign
• Execution
oCode
oTest
• Deployment
oSys Adm nightmare?
Web Application Lifecycle
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 21: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/21.jpg)
• Planning
oRequirement Analysis
oDesign
• Execution
oCode
oTest
• Deployment
oSys Adm nightmare?
Web Application Lifecycle
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 22: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/22.jpg)
• Planning
oRequirement Analysis
oDesign
• Execution
oCode
oTest
• Deployment
oSys Adm nightmare?
Web Application Lifecycle
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 23: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/23.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirement
Architecture
•Design Diagrams (Technical )•HLD•Blueprint
![Page 24: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/24.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
"Real performance is architecture-driven”- R.Lerdorf
http://goo.gl/abCVp
![Page 25: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/25.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
"PHP is rarely the bottleneck”
-R.Lerdorf
![Page 26: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/26.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Front End
Back End
![Page 27: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/27.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Front End
nginx Zend Server
![Page 28: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/28.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Back End
Zend Server
MySQL
![Page 29: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/29.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirementArchitecture
Tools
•Planning•Development•Deployment
![Page 30: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/30.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirementArchitectureTools
Foundation
•Stable?•Framework vs No-Framework•On Your Own Frame to-do work
![Page 31: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/31.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirementArchitectureToolsFoundation
Design patterns
•Best practice of solving probs.•MVC?
![Page 32: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/32.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirementArchitectureToolsFoundationDesign patterns
Testing
•Developer, Unit, Functional, Performance, Integration,Usability
![Page 33: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/33.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirementArchitectureToolsFoundationDesign patternsTesting
Optimization
•They want it fast•We need
•Accelerator (eAccelerator, Alternative PHP Cache, ionCubePHP Accelerator,Turck MMCache,XCache,NuspherePhpExpress,Zend Optimizer+,Zend Platform •Cache (Smarty, Zend_Cache, Memcached)
![Page 34: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/34.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
"Premature optimization is the root of all evil ”- Donald Knuth
http://goo.gl/twTea
![Page 35: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/35.jpg)
• System calls
oweb server processes
o Index
oWeb server config
o Include
o S-L-D-Ktrace / truss
Where to start
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 36: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/36.jpg)
• Include hierachy > redundancy
oTools > pecl/inclued
o include_once/require_once
oGraph
Find the culprit
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 37: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/37.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
"Profile your code to pinpoint bottlenecks”
- Eric Higgins
![Page 38: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/38.jpg)
• Code
• Network
• DB
• System
Areas
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 39: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/39.jpg)
• xdebug
• valgrind.org
• Xhprof
• Zend Studio/Server
Profiling Tools
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 40: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/40.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirementArchitectureToolsFoundationDesign patternsTestingOptimization
Security
•Prevention of harmful event(s)•Real Risk•Severe consequences
http://goo.gl/nPgwj
![Page 41: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/41.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirementArchitectureToolsFoundationDesign patternsTestingOptimizationSecurity
Deployment
•Develop, Test, Deploy (Test, Live)•Simple XAMPP to HA, Scalable architecture
![Page 42: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/42.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
“Every nanoseconds count!” - My Big Boss(your boss also)
http://geekonfilm.files.wordpress.com/2009/09/vader.jpg
![Page 43: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/43.jpg)
• Design
o Algorithm used
o Architecture
o Special tricks
• Code
o Avoid ‘slowdowns’
• Deploy
o “it works on my dev machine!”
Layers
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 44: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/44.jpg)
• Measure
• Benchmark
• Analyse
• (Loop?)
Performance Enhancement
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 45: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/45.jpg)
• Avoid Premature Optimization
• Measuring Performance
oMemory and CPU Measurement
o Requests Per Second
• Pinpointing The Cause Of Poor Performance
• Code Profiling
• Database Operations Analysis
• General PHP Optimisation
o Opcode Caching
o Realpath Cache
Key Points
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 46: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/46.jpg)
• General Zend Framework Optimization
o Class Loading Optimisation
o Configuring Default Caches
o Cache At The Right Level
o Minimising Include Paths
• HTTP Server Optimization
o Optimising Apache's Configuration
o Avoiding Apache Completely
Key Points
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 47: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/47.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirementArchitectureToolsFoundationDesign patternsTestingOptimizationSecurityDeployment
Operation•Helpdesk•Monitoring•Root cause analysis•Change management
![Page 48: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/48.jpg)
Enterprise PHP
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
TEAMRequirementArchitectureToolsFoundationDesign patternsTestingOptimizationSecurityDeploymentOperation
![Page 49: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/49.jpg)
Who Am I
PHP Center of Excellence
The Curious Case of Enterprise PHP
Summary
Agenda
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 50: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/50.jpg)
• Objectives & constraints
• What is the Problems
• Don’t make assumptions (VNV it)
• Right tools (but tools is just a tools)
• Use profiler with benchmarks
• Resources are limited (monitor them)
Checklist
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
![Page 51: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/51.jpg)
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
Ready to make your web apps fly?
http://goo.gl/abCVp
![Page 52: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/52.jpg)
Resources
www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
• Eric Higgins, Google Webmaster code.google.com/speed/articles/optimizing-php.html
• Rasmus’s talk at Hacker Dojo http://talks.php.net/show/digg/
• code.google.com/speed/page-speed
• developer.yahoo.com/performance/rules.html
• www.zend.com/en/products/server
• www.nginx.net
• www.survivethedeepend.com
• pecl.php.net/package/xhprof
• github.com/facebook/xhprof
![Page 53: Accelarating PHP Applications at INTAN Sabah Technology Updates 2011](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5559c374d8b42a236c8b53cd/html5/thumbnails/53.jpg)
THANK YOU
www.mimos.my © 2009 MIMOS Berhad. All Rights Reserved.
@errazudin
* All images, logos and data are the copyright of their respective owners