Accelarating PHP Applications at INTAN Sabah Technology Updates 2011

1,421 views
1,338 views

Published on

"Accelarating PHP Applications" Presented at INTAN Sabah Technology Updates 2011

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,421
On SlideShare
0
From Embeds
0
Number of Embeds
31
Actions
Shares
0
Downloads
15
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Accelarating PHP Applications at INTAN Sabah Technology Updates 2011

  1. 1. Accelerating PHP Applications Errazudin Ishakwww.mimos.my © 2009 MIMOS Berhad. All Rights Reserved.
  2. 2. Agenda Who Am I PHP Center of Excellence The Curious Case of Enterprise PHP Summarywww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  3. 3. Me 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, MyGOSSCONwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  4. 4. Agenda Who Am I PHP Centre of Excellence The Curious Case of Enterprise PHP Summarywww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  5. 5. phpcoe.mimos.mywww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  6. 6. 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.www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  7. 7. Events : Enterprise PHP Tech talk www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  8. 8. Events : Facebook Developer Garage www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  9. 9. Events : PHP Malaysia Meetup www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  10. 10. Events : PHP Northwest, UK www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  11. 11. http://goo.gl/EbTI Accelerating PHP Applicationwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  12. 12. The Newswww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  13. 13. iSDP Intelligent Service Delivery Platformwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  14. 14. The struggle begins..www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  15. 15. Agenda Who Am I PHP Center of Excellence The Curious Case of Enterprise PHP (How actually we makes PHP apps fly) Summarywww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  16. 16. Enterprise == ?www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  17. 17. DBA Enterprise PHP DesignerTEAM Sys. Ad Tester PHP Geek PM Project Lead BA www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  18. 18. Enterprise PHPTEAMRequirement •Customer need this … •User want that … •My boss add this … •My BA... more headache … www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  19. 19. "Faster sites create happy users”– Google, April 9, 2010 www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved. http://www.flickr.com/photos/36230948@N05/
  20. 20. Web Application Lifecycle • Planning o Requirement Analysis o Design • Execution o Code o Test • Deployment o Sys Adm nightmare?www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  21. 21. Web Application Lifecycle • Planning o Requirement Analysis o Design • Execution o Code o Test • Deployment o Sys Adm nightmare?www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  22. 22. Web Application Lifecycle • Planning o Requirement Analysis o Design • Execution o Code o Test • Deployment o Sys Adm nightmare?www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  23. 23. Enterprise PHPTEAMRequirementArchitecture •Design Diagrams (Technical ) •HLD •Blueprint www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  24. 24. "Real performance is architecture-driven” - R.Lerdorfwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved. http://goo.gl/abCVp
  25. 25. "PHP is rarely the bottleneck” -R.Lerdorf www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  26. 26. Front End Back Endwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  27. 27. Front End nginx Zend Serverwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  28. 28. Zend Server Back End MySQLwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  29. 29. Enterprise PHPTEAMRequirementArchitectureTools •Planning •Development •Deployment www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  30. 30. Enterprise PHPTEAMRequirementArchitectureToolsFoundation •Stable? •Framework vs No-Framework •On Your Own Frame to-do work www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  31. 31. Enterprise PHPTEAMRequirementArchitectureToolsFoundationDesign patterns •Best practice of solving probs. •MVC? www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  32. 32. Enterprise PHPTEAMRequirementArchitectureToolsFoundationDesign patternsTesting •Developer, Unit, Functional, Performance, Integration, Usability www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  33. 33. Enterprise PHPTEAMRequirementArchitectureToolsFoundationDesign patternsTestingOptimization •They want it fast •We need •Accelerator (eAccelerator, Alternative PHP Cache, ionCube PHP Accelerator,Turck MMCache,XCache,Nusphere PhpExpress,Zend Optimizer+,Zend Platform •Cache (Smarty, Zend_Cache, Memcached) www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  34. 34. "Premature optimization is the root of all evil ” - Donald Knuthwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved. http://goo.gl/twTea
  35. 35. Where to start • System calls o web server processes o Index o Web server config o Include o S-L-D-Ktrace / trusswww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  36. 36. Find the culprit • Include hierachy > redundancy o Tools > pecl/inclued o include_once/require_once o Graphwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  37. 37. "Profile your code to pinpoint bottlenecks” - Eric Higginswww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  38. 38. Areas • Code • Network • DB • Systemwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  39. 39. Profiling Tools • xdebug • valgrind.org • Xhprof • Zend Studio/Serverwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  40. 40. Enterprise PHPTEAMRequirementArchitectureToolsFoundationDesign patternsTestingOptimizationSecurity •Prevention of harmful event(s) •Real Risk •Severe consequences www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved. http://goo.gl/nPgwj
  41. 41. Enterprise PHPTEAMRequirementArchitectureToolsFoundationDesign patternsTestingOptimizationSecurityDeployment •Develop, Test, Deploy (Test, Live) •Simple XAMPP to HA, Scalable architecture www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  42. 42. “Every nanoseconds count!” - My Big Boss (your boss also) http://geekonfilm.files.wordpress.com/2009/09/vader.jpgwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  43. 43. Layers • Design o Algorithm used o Architecture o Special tricks • Code o Avoid ‘slowdowns’ • Deploy o “it works on my dev machine!”www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  44. 44. Performance Enhancement • Measure • Benchmark • Analyse • (Loop?)www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  45. 45. Key Points • Avoid Premature Optimization • Measuring Performance o Memory 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 Cachewww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  46. 46. Key Points • 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 Apaches Configuration o Avoiding Apache Completelywww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  47. 47. Enterprise PHPTEAMRequirementArchitectureToolsFoundationDesign patternsTestingOptimizationSecurityDeploymentOperation •Helpdesk •Monitoring •Root cause analysis •Change management www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  48. 48. Enterprise PHPTEAMRequirementArchitectureToolsFoundationDesign patternsTestingOptimizationSecurityDeploymentOperationwww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  49. 49. Agenda Who Am I PHP Center of Excellence The Curious Case of Enterprise PHP Summarywww.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  50. 50. Checklist • 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)www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  51. 51. Ready to make your web apps fly?www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved. http://goo.gl/abCVp
  52. 52. Resources• 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 www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  53. 53. THANK YOU @errazudin errazudin.ishak@mimos.my* All images, logos and data are the copyright oftheir respective owners www.mimos.my © 2009 MIMOS Berhad. All Rights Reserved.

×