Your SlideShare is downloading. ×
0
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Developing Easily Deployable PHP Applications ( OSCON 2010 )
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Developing Easily Deployable PHP Applications ( OSCON 2010 )

2,151

Published on

Here’s the scenario: you’ve wrote a PHP application that is designed to run on Linux, Apache, and MySQL Now you have a customer that wants to run it on Windows. Or using Oracle. Or they like Memcache …

Here’s the scenario: you’ve wrote a PHP application that is designed to run on Linux, Apache, and MySQL Now you have a customer that wants to run it on Windows. Or using Oracle. Or they like Memcache instead of APC. How do you do it, without sacrificing performance, stability, simplicity, and your own sanity?

In this talk, we’ll look at how we approached this problem at SugarCRM, and what lessons we learned in the process.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,151
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
45
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • People fear the cloudPeople can’t use the cloudPeople want to use different cloudsOur customer base reflects this ( 1/3 sugar cloud, 1/3 on site, 1/3 on other clouds )
  • User base is diverse, likes different offerings, and will move between them.Lots of choices ( Web Servers / OSes / Databases / PHP versions ) as well as config possibilitiesHave to cover lots of platforms; can rely on particular hardware or software being available.
  • PHP matrix covers most of the recent linuxdistros, and updates are easily available if your stack doesn’t match up
  • Performance story about GNs; very particular to make go fastNeed to balance performance and configurability; make the performance choices that make the most difference, and enable ways for those working with your software to make more.
  • Try to avoid subqueries as much as possible.
  • Relate in picture, mention about balance for needed control and simplicity.Talk about how we made this a big deal in Sugar 6
  • Types of testing we useTesting is hard
  • Transcript

    • 1. Developing Easily Deployable PHP Applications<br />John Mertic<br />SugarCRM<br />@2010 SugarCRM Inc. All rights reserved.<br />
    • 2. Why deployable apps still matter<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />2<br />
    • 3. What I’ll cover<br />Code portability<br />Performance<br />Configuration and Customization<br />Testing/QA<br />@2010 SugarCRM Inc. All rights reserved.<br />7/22/2010<br />3<br />
    • 4. Code Portability<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />4<br />Source: http://www.flickr.com/photos/25339258@N05/2389910825/<br />
    • 5. What we do<br />Limit support to the most common configurations<br />As of SugarCRM 6.0 we officially support:<br />Operating System<br />Windows XP, 2003, 2008, Vista<br />Red Hat 4.x, 5.x<br />Oracle Enterprise Linux 5.1<br />CentOS 4.x, 5.x<br />Web Server<br />Apache 1.3, 2.0, 2.2<br />IIS 6/7 using FastCGI<br />Database<br />MySQL 5.0, 5.1<br />SQL Server 2005, 2008<br />Oracle 9i, 10g<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />5<br />
    • 6. What we do (cont)<br />PHP Support Matrix<br />5.2.1 - 5.2.6, 5.2.8 - 5.2.13, 5.3.0 - 5.3.2<br />Support most common configurations options<br />mbstring.func_overload = 7<br />error_reporting = E_ALL<br />Require only the most mainline extensions, plus<br />Mbstrings ( for i18n support )<br />Imap ( if using mail support )<br />Specific database extension ( mysql, mysqli, oci8, mssql, sqlsrv )<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />6<br />
    • 7. Build and Deploy<br />We build all 3 editions of SugarCRM from 1 codebase<br />We add code tags around sections specific to a certain version.<br />To test under each different edition, developers can run the build locally<br />Removes code not belonging to the given edition<br />Add appropriate license headers<br />Each check-in triggers a lint check and unit test run against each edition across different platforms.<br />We run nightly builds to run functional tests and to send to QA for manual testing.<br />SODA / SodaMachine – tool to easily write functional tests that run under Watir.<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />7<br />
    • 8. Performance<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />8<br />Source: http://www.flickr.com/photos/tech1987/501427718/<br />
    • 9. What we do to help performance<br />Caching, and lots of it<br />Smarty template caching<br />Data caching<br />Combine, minify, and version JS / CSS / images<br />Keep SQL queries as simple as possible<br />Provide configuration options to turn off heavy features<br />Enable the application to take advantage of it’s environment<br />Examples:<br />Use APC, memcache, Zend_Cache, wincache with little to no configuration<br />Leverage a slave database for heavy queries<br />Detect Full Text Indexing on SQL Server<br />Detect for certain PHP extensions being enabled.<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />9<br />
    • 10. How we gauge performance<br />Formal testing<br />Use Jmeter (http://jakarta.apache.org/jmeter/) on a load test cluster to test raw response speed.<br />MeterMaid / SugarMMM – open source tool we created to make writing tests easier<br />TidBit – open source tool we created to make huge datasets<br />Instance analysis<br />Monitor web server logs to look for non-cached items<br />Track slow queries<br />Ad-hoc testing<br />Profile PHP execution with XDebug<br />Use Firebug to measure CSS / JS / image payload<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />10<br />
    • 11. Configuration and Customization<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />11<br />Source: http://www.flickr.com/photos/miskypig/400004362/<br />
    • 12. Making it simple yet powerful for end users<br />Expose configuration options thru multiple channels<br />Remember, not everyone has source access<br />Allow users to customize their UI interface easily<br />Make what should be simple, simple<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />12<br />
    • 13. Making it simple yet powerful for developers<br />Create a safe place to make customizations<br />Avoid painful upgrades<br />Create an easy to use API<br />Well defined and supported.<br />Don’t break it!<br />Create easy to use hooks for modifying existing / adding new functionality<br />Examples from SugarCRM include:<br />Metadata driven views<br />Logic Hooks<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />13<br />
    • 14. Testing/QA<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />14<br />Source: http://www.flickr.com/photos/cglock/386033158/<br />
    • 15. Testing different configurations<br />Impossible for us to test every single permutation.<br />We use VM stacks; for SugarCRM 6, we use<br />Windows Vista IIS-7 (FastCGI)PHP 5.2.8 MSSQL-2005 (PHPmssql driver)<br />Windows Server 2003 IIS-6 (FastCGI)PHP 5.2.11 MSSQL-2005 (PHPmssql driver)<br />CentOS5 Apache-2.2.11PHP 5.2.9 MySQL-5.1.33<br />Windows Server 2008 IIS-7 (FastCGI)PHP 5.3.1 MSSQL-2008 (Microsoft sqlsrv driver 1.1)<br />Windows XP Apache-1.3.41PHP 5.2.13 MySQL-5.0.83<br />Oracle Enterprise Linux 5.1 Apache-2.0.63PHP 5.3.2 ORCL-10g<br />We test both new installations and upgrade scenarios<br />Even customer instances!<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />15<br />
    • 16. About me and my company <br />John Mertic<br />http://jmertic.wordpress.com<br />Twitter: @jmertic<br />jmertic@sugarcrm.com ( Work )<br />jmertic@php.net ( PHP )<br />Slides available on slidesharehttp://bit.ly/a7NOR1<br />SugarCRM<br />http://www.sugarcrm.com<br />We’re hiring!<br />Learn more about SugarCRM’sopen source tools at http://developers.sugarcrm.com/opensource<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />16<br />Buy my book!<br />
    • 17. Questions?<br />Thanks for coming!<br />7/22/2010<br />@2010 SugarCRM Inc. All rights reserved.<br />17<br />

    ×