bay area drupal camp efficiency

Download Bay Area Drupal Camp Efficiency

Post on 21-Jan-2015

1.340 views

Category:

Technology

2 download

Embed Size (px)

DESCRIPTION

Slides presented at Bay Area Drupal Camp San Francisco, June 6 2009

TRANSCRIPT

  • 1. When Efficiency Matters for Drupal Scott MattoonSun Microsystems, Inc.http://blogs.sun.com/downstreamhttp://twitter.com/smattoon 1Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009

2. Agenda2Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 3. NetBeans for DrupalBay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 4. NetBeans for Drupal PHP Plugin http://wiki.netbeans.org/PHP Run and Debug project action break points, watches Run single file, Debug single file, Run in command line Wizard for creating new php and phtml files Editing - Syntactic and Semantic coloring Code Completion File system code completion for include/require Bracket Matching Automatic Insertions (brackets, braces, parens, quotes) Code Navigation - Go to Declaration/Type, Hyperlinking Refactoring - Instant Rename Drupal Module and Theme Wizard http://is.gd/lgnB generates required files provides template code Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 5. Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 6. VirtualBox for DrupalBay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 7. Top 10 Reasons for Running Virtual Box 10 - You want to impress your friends.9 - Your wife has told you one more computer in the houseand she's gone.8 - Windows 3.1 is your favorite operating system.7 - You want to make sure you have deleted all traces ofwhat you have done.6 - You want to give root to your baby sister.5 - You want to try writing a kernel module while drunk.4 - You want to install that cracked version of Photo Shop.3 - You've always wondered what deleting /bin would do.2 - You really REALLY want to click on that email attachment.1 - You like running that older version of Internet Explorer. Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 8. Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 9. OpenSolaris for Drupal9Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 10. Glassfish WebStack OpenSolaris AMP +++ Apache2.2.11Python 2.6.1lighttpd1.4.21memcached1.2.5Squid 2.7.6 Apache Tomcat6.0.18MySQL5.10 Glassfish Enterprise2.1PHP 5.2.9 Web Stack Manager 1.5Ruby1.8.7nginx 0.6.35webstack-dev-tools0.1Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 11. Solaris Linux PerformanceBay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 12. Solaris Linux Performance THROUGHPUT Lightweight & Complex WorkloadsBay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 13. Solaris Linux Performance THROUGHPUT zoom in Complex WorkloadsBay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 14. The S in SAMP stands for Solaris Solaris Zones Free, lightweight and easy virtualization Allocate a system to each app instance or to each developer Resources are controlled in one of three ways Capped Resources: Upper limit on consumption Guaranteed Resources: Guarantee of a minimum available Dedicated Resources: Resources are set aside for share filesystems and network across zonesOR dedicate filesystems and network to individual zones14Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 15. Need Efficiency & Control?Hypothetical Constraints & ObjectivesConstraints: one server available need to host four environments: (2) Developers (1) Test environment (1) Production environment Objectives: maximize sharing, minimize redundancy guarantee max. resources for production maximize efficiency & consistency btw. envs. 15 Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 16. Solaris Zones for Efficiency & ControlglobalzonezoneA zoneB... qazoneprodzoneApacheApache Apache PHP PHP PHPdbzone1 Apache PHPMySQLMySQLBay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 17. Solaris Zones for Efficiency & ControlglobalzonezoneA zoneB... qazoneprodzone/usr/ -ro-ro/usr ./apache-ro ./mysql -ro ./php -rw/data/drupal-6.12-rw -ro -ro/data/drupal-5.10 ./misc -ro-ro ./modules-ro-ro ./scripts -ro -ro ./sites -rw -ro ./themes -ro-ro ./files-ro-rw Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 18. Find Hampster Wheels with DTrace DTrace provider for PHPDTrace is one of those tools that makes you wonder how you did anything without it before you'd heard of it.Why is it better than strace and similar tools? It's non-invasive, fast, scriptable and extensible.- Wez Furlong Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 19. Performance Tuning - DEMO DTrace provider for PHP Which functions are being called by Drupal? # dtrace -n function-entry'{printf(quot;called %s() in %s at line %dnquot;,copyinstr(arg0), copyinstr(arg1), arg2)}' -qHow many times is a function called? # dtrace -n function-entry'{@[copyinstr(arg0)] = count()}'What's the file name and line number count: # dtrace -n function-entry'{@[copyinstr(arg1)] =lquantize(arg2, 0, 5000)}'Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 20. Security RBAC Assign users to roles with privileges they need Process Rights Management Run with least privileges E.g., not root, nosuid, noexec20Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 21. Versioning & Protecting Data ZFS snapshots & Rollback $ zfs snapshot /data/site@31Oct $ zfs snapshot /data/site@01Nov - - - DEPLOY -> SMOKE-TEST -> UH-OH! - - - $ cp .zfs/snapshot/@01Nov/Drupal_5.2/themes/mysite ./Drupal_5.2/themesBay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 22. Project Caroline Cloud Computing - Platform as a ServiceInternet Resource TypesYour Service CodeLaunch service usingmultiple load-balanced +processes, connected to a backend database.Flex processes tomatch demand.Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 23. Drupal and Java PHP apps on GlassfishTwo Options: Quercus http://caucho.com/products/quercus.xtp LRWP on Glassfish http://is.gd/mhxP Gives you: Database connection pooling JIT Compiler Makes possible clustering with Terracotta Access to vast Java class libraryBay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 24. Cool Drupal Site on Solaris 24Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 25. Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 26. 7 Creative Commons Licenses Drupal 5.10 + >12 new modules X64 tuned Webstack Solaris 10 (2) SunFire X2200 M2 servers (1) 6TB SunStorage 3511 Hosted at AMD datacenter 26Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 27. Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 28. Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 29. For More Information Get OpenSolaris http://opensolaris.org/os/downloads/ ZFS http://opensolaris.org/os/community/zfs/ http://tinyurl.com/235vxe RBAC http://blogs.sun.com/darren/tags/rbac Project Caroline https://www.projectcaroline.net/ VBox Free Virtualization software http://www.virtualbox.org/ Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 30. For More Information NetBeans http://www.netbeans.org/ VBox Free Virtualization software http://www.virtualbox.org/ Project Caroline https://www.projectcaroline.net/ Glassfish http://glassfish.java.net/ Running MySQL in Solaris Zones http://wikis.sun.com/display/BluePrints/Running+MySQL+Database+in+Solaris+Containers%20 Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 31. For More Information Get OpenSolaris http://opensolaris.org/os/downloads/ ZFS http://opensolaris.org/os/community/zfs/ http://tinyurl.com/235vxe SMF & Security http://www.opensolaris.org/os/community/smf/ http://www.sun.com/software/solaris/howtoguides/s10securityhowto.jsp DTrace http://blogs.sun.com/bmc/entry/dtrace_and_php_demonstrated http://blogs.sun.com/angelo/entry/dtrace_meet_the_amp_apache RBAC http://blogs.sun.com/darren/tags/rbac Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 32. Q&A Scott Mattoonhttp://blogs.sun.com/downstreamtwitter: smattoon Bay Area Drupal Camp 2009 San Francisco | When Efficiency Matters - Drupal at Scale Monday, June 8, 2009 33. Resource Management & IsolationProjects and Zone resource configuration Projects# projadd -c quot;Apache-PHPquot; -U webservd httpd.php# projmod -sK quot;project.max-sem-ids=(privileged,256,deny)quot; httpd.php# svccfg -s http:CSKapache2 setprop start/project = astring: httpd.php# svcadm -v enable CSKapache2 CPU Sharesglobal# zonecfg -z zone1zonecfg:zone1> add rctlzonecfg:zone1:rctl> set name=zone.cpu-shareszonecfg:zone1:rctl> add value (priv=privileged,limit=15,action=none)zonecfg:zo