SlideShare a Scribd company logo
1 of 47
Download to read offline
Joomla! Day
                                     Malaysia 2011



                                    Making Joomla! Site fly with Nginx
                                    Errazudin Ishak




www.mimos.my   © 2009 MIMOS Berhad. All Rights Reserved.
Agenda

        • Me
        • Joomla!
        • “engine X”
        • Benchmarks
        • Samples




www.mimos.my      © 2011 MIMOS Berhad. All Rights Reserved.
About Me
        • Errazudin Ishak
        • @errazudin
        • Senior engineer @ Mimos Bhd Malaysia
        • Focuses on web application development,
          deployment, performance and stability.
        • 2009 : foss.my , MyGOSSCON
        • 2010 : Entp. PHP Techtalk, BarcampKL, PHP
                 Meetup, MOSC2010, PHP Northwest UK,
                 MyGOSSCON
        • 2011 : INTAN Tech Update, Wordpress Conf. Asia

www.mimos.my          © 2011 MIMOS Berhad. All Rights Reserved.
www.mimos.my   © 2011 MIMOS Berhad. All Rights Reserved.
Joomla!




               23.5mil                                            *downloads


                                                              Techcrunch June 11th;
                                                               http://goo.gl/DTveS




www.mimos.my      © 2011 MIMOS Berhad. All Rights Reserved.
Joomla! 1.6




               +2.5mil                                                *downloads


                                                                  Techcrunch June 11th;
                                                                   http://goo.gl/DTveS




www.mimos.my          © 2011 MIMOS Berhad. All Rights Reserved.
www.mimos.my   © 2011 MIMOS Berhad. All Rights Reserved.
nginx

        • Free
        • X platform
        • open-source
        • (high-performance)
        • lightweight
        • HTTP server
        • reverse proxy
        • IMAP/POP3 proxy server
www.mimos.my      © 2011 MIMOS Berhad. All Rights Reserved.
http://commons.wikimedia.org/wiki/File:Whittle_Jet_Engine_W2-700.JPG




      “I'm the author of nginx (pronounced "engine x")-
      Igor Sysoev
      (nginx creator)
www.mimos.my            © 2011 MIMOS Berhad. All Rights Reserved.
http://www.litchfieldimports.co.uk/forum/gtr-engine-bay.jpg




                                        Load Balance
                                        Static Content, Index files
                                        Reverse Proxy (with cache)
                                        Streaming




www.mimos.my   © 2011 MIMOS Berhad. All Rights Reserved.
http://noisetu.be/mirrors/jet_beetle/




 Loads of Request
 Less memory footprint
 Use less CPU
 C10K Certified


www.mimos.my     © 2011 MIMOS Berhad. All Rights Reserved.
http://www.gtrblog.com/wp-content/uploads/2008/11/gtr-gt2-nurburgring-001.jpg




  Apache
  ----------                                         --------
  Processes                                          Async model
  Threads                                            Single Thread
  High Memory                                        Low Memory
  CPU Overhead                                       Less CPU
  PHP included as                                    PHP as separate proc.
  module (mod_php)                                   over FastCGI




www.mimos.my    © 2011 MIMOS Berhad. All Rights Reserved.
Boston.com




                                                           Numbers




www.mimos.my   © 2011 MIMOS Berhad. All Rights Reserved.
Market Share for Top Servers Across All Domains




Source :
Netcraft
  www.mimos.my          © 2011 MIMOS Berhad. All Rights Reserved.
Market Share for Top Servers Across All Domains




Source :
Netcraft
  www.mimos.my          © 2011 MIMOS Berhad. All Rights Reserved.
Market Share for Top Servers Across the Million Busiest
          Sites




Source :
Netcraft
  www.mimos.my             © 2011 MIMOS Berhad. All Rights Reserved.
Market Share for Top Servers Across the Million Busiest
          Sites




Source :
Netcraft
  www.mimos.my             © 2011 MIMOS Berhad. All Rights Reserved.
http://goo.gl/KJC8H




                                                           Who?




www.mimos.my   © 2011 MIMOS Berhad. All Rights Reserved.
Me uses nginx




www.mimos.my        © 2011 MIMOS Berhad. All Rights Reserved.
Me uses nginx




www.mimos.my        © 2011 MIMOS Berhad. All Rights Reserved.
We also..




www.mimos.my        © 2011 MIMOS Berhad. All Rights Reserved.
We all love nginx…




www.mimos.my        © 2011 MIMOS Berhad. All Rights Reserved.
Modules

                          Mail, 3rd
                           Party
                           Optional
                               HTTP

                           Standard
                             HTTP



                            Core

www.mimos.my      © 2011 MIMOS Berhad. All Rights Reserved.
Modules


               Mail Core, Mail Auth, Mail Proxy, Mail SSL


 HTTP Addition, Emb. Perl, FLV, Gzip Precompression, Random Index,
GeoIP, Real IP, SSL, Stub Status, Substitution, WebDAV, Google Perftools,
                       XSLT, Secure Link, Image Filter

 HTTP Core, HTTP Upstream, HTTP Access, HTTP Auth Basic, HTTP Auto
 Index, Browser, Charset, Empty gif, FastCGI, Geo, Gzip, HTTP Headers,
 Index, HTTP Referer, HTTP Limit Zone, HTTP Limit Requests, Log, Map,
           Memchached, HTTP Proxy, Rewrite, SSI, User ID



                          Main, Events
www.mimos.my              © 2011 MIMOS Berhad. All Rights Reserved.
Nginx with PHP

        • FastCGI
        • PHP-FPM (FastCGI Process Manager)
               • Bundled with PHP 5.3.3




www.mimos.my              © 2011 MIMOS Berhad. All Rights Reserved.
Nginx with PHP : FastCGI

        • persistent processes, ability to handle multiple
          requests.
        • web server and gateway application
          communicate with sockets such as TCP
        • web server forwards the client request to the
          gateway and receives the response within a
          single connection
        • can be implemented on any platform with any
          programming language.



www.mimos.my           © 2011 MIMOS Berhad. All Rights Reserved.
Nginx with PHP : FastCGI

     server {
       server_name mysite.com;
       listen 80;
       root /usr/share/mysite/www;
       index index.html;
       location / {
           fastcgi_pass 127.0.0.1:9000;
           fastcgi_param SCRIPT_FILENAME
       $document_root$fastcgi_script_name;
           fastcgi_param PATH_INFO $fastcgi_script_name;
           include fastcgi_params;
       }
     }


www.mimos.my         © 2011 MIMOS Berhad. All Rights Reserved.
Nginx with Joomla!
     server {
       server_name yourdomain.com;
       large_client_header_buffers 4 8k;
       root /var/www/joomla;
       index index.php index.html;
       location / {
         try_files $uri $uri/ /index.php?q=$request_uri;
       }
        location ~ .php$ {
         fastcgi_pass 127.0.0.1:9000;
         fastcgi_index index.php;
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME
       $document_root$fastcgi_script_name;
       }
     }
www.mimos.my         © 2011 MIMOS Berhad. All Rights Reserved.
PHP-FPM

        • FastCGI Process Manager
        • Daemonizes PHP > background proc
        • provides a command-line script for
          managing PHP proc
        • configuration of FastCGI pools
        • enhances some of the FastCGI internals
        • increases error reporting
        • script termination

www.mimos.my         © 2011 MIMOS Berhad. All Rights Reserved.
Benchmarks
http://www.myshutterspace.com/profile/AthonySaucedo



        www.mimos.my                                  © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : Specs

        •      Intel Core Duo
        •      T2400, 1.83 GHz
        •      2GB RAM
        •      OS- Fedora 12




www.mimos.my             © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : apacheBench

        • -n 100
        • -c 20




www.mimos.my       © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : nginx




www.mimos.my        © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : apache




www.mimos.my       © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : Findings




                    Apache 2.2.15 Nginx 0.7.67
     Concurrency    20                                 20
     Doc size       674600bytes                        658000bytes
     Complete       100%                               100%
     Request
     Req per secs   7.2                                8.8
     Longest Req    4848ms                             2638ms



www.mimos.my           © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : apacheBench

        • -n 500
        • -c 50




www.mimos.my       © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : nginx




www.mimos.my        © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : apache




www.mimos.my       © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : Findings


                Apache 2.2.12                Nginx 0.7.62
Concurrency     50                           50
Doc size        3373300 bytes                3290000 bytes
Complete        100%                         100%
Request
Req per secs    7.93                         8.47
Longest Req     12154 ms                     6374 ms




 www.mimos.my          © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : apacheBench

        • -n 1000
        • -c 100




www.mimos.my        © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : nginx




www.mimos.my        © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : apache




www.mimos.my       © 2011 MIMOS Berhad. All Rights Reserved.
Benchmark : Findings


                Apache 2.2.12                Nginx 0.7.62
Concurrency     100                          100
Doc size        6746000 bytes                6580000 bytes
Complete        100%                         100%
Request
Req per secs    7.91                         8.48
Longest Req     19268 ms                     12196 ms




 www.mimos.my          © 2011 MIMOS Berhad. All Rights Reserved.
http://goo.gl/4SAnf




               “Every nanoseconds count!” - My Big Boss
               (your boss also)


www.mimos.my                      © 2011 MIMOS Berhad. All Rights Reserved.
http://goo.gl/xmdsy




                                                              Demo

www.mimos.my   © 2011 MIMOS Berhad. All Rights Reserved.
Resources


• http://wiki.nginx.org/Main
• Nedelcu’s book http://goo.gl/67OA
• Nginx 1 Web Server Implementation Cookbook
  http://goo.gl/46UYq
• http://php-fpm.org/
• http://nginx.org




 www.mimos.my        © 2011 MIMOS Berhad. All Rights Reserved.
THANK YOU

                                                                                                            @errazudin
                                                                                                errazudin.ishak@mimos.my
                                                                                                errazudin.ishak@gmail.com

* All images, logos and data are the copyright of
their respective owners
     www.mimos.my                                   © 2011 MIMOS Berhad. All Rights Reserved.

More Related Content

Similar to Making Joomla! site fly with nginx : Joomla! day Malaysia 2011

Open sourcetechnologiessuccessstory allcountry_ver1.0
Open sourcetechnologiessuccessstory allcountry_ver1.0Open sourcetechnologiessuccessstory allcountry_ver1.0
Open sourcetechnologiessuccessstory allcountry_ver1.0
GeoTech Informatics
 
Enabling the Enterprise with Next-Generation Mobile Architectures - Mark Vand...
Enabling the Enterprise with Next-Generation Mobile Architectures - Mark Vand...Enabling the Enterprise with Next-Generation Mobile Architectures - Mark Vand...
Enabling the Enterprise with Next-Generation Mobile Architectures - Mark Vand...
mfrancis
 
Website security systems
Website security systemsWebsite security systems
Website security systems
Mobile88
 
IoT with Apache MXNet and Apache NiFi and MiniFi
IoT with Apache MXNet and Apache NiFi and MiniFiIoT with Apache MXNet and Apache NiFi and MiniFi
IoT with Apache MXNet and Apache NiFi and MiniFi
DataWorks Summit
 

Similar to Making Joomla! site fly with nginx : Joomla! day Malaysia 2011 (20)

Rise of the Planet of the Anonymous
Rise of the Planet of the AnonymousRise of the Planet of the Anonymous
Rise of the Planet of the Anonymous
 
DA with Wa - Desktop Apps With Web Apps
DA with Wa - Desktop Apps With Web AppsDA with Wa - Desktop Apps With Web Apps
DA with Wa - Desktop Apps With Web Apps
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
 
Scalable applications with HTTP
Scalable applications with HTTPScalable applications with HTTP
Scalable applications with HTTP
 
Analysis & Design Method for OSGi-based Development
Analysis & Design Method for OSGi-based DevelopmentAnalysis & Design Method for OSGi-based Development
Analysis & Design Method for OSGi-based Development
 
Open sourcetechnologiessuccessstory allcountry_ver1.0
Open sourcetechnologiessuccessstory allcountry_ver1.0Open sourcetechnologiessuccessstory allcountry_ver1.0
Open sourcetechnologiessuccessstory allcountry_ver1.0
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
 
Mule Integration Simplified
Mule Integration SimplifiedMule Integration Simplified
Mule Integration Simplified
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web Services
 
20191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 120191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 1
 
Easy Docker Deployments with Mesosphere DCOS on Azure
Easy Docker Deployments with Mesosphere DCOS on AzureEasy Docker Deployments with Mesosphere DCOS on Azure
Easy Docker Deployments with Mesosphere DCOS on Azure
 
Enabling the Enterprise with Next-Generation Mobile Architectures - Mark Vand...
Enabling the Enterprise with Next-Generation Mobile Architectures - Mark Vand...Enabling the Enterprise with Next-Generation Mobile Architectures - Mark Vand...
Enabling the Enterprise with Next-Generation Mobile Architectures - Mark Vand...
 
Website security systems
Website security systemsWebsite security systems
Website security systems
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
 
Mobile applications chapter 4
Mobile applications chapter 4Mobile applications chapter 4
Mobile applications chapter 4
 
MiniFi and Apache NiFi : IoT in Berlin Germany 2018
MiniFi and Apache NiFi : IoT in Berlin Germany 2018MiniFi and Apache NiFi : IoT in Berlin Germany 2018
MiniFi and Apache NiFi : IoT in Berlin Germany 2018
 
IoT with Apache MXNet and Apache NiFi and MiniFi
IoT with Apache MXNet and Apache NiFi and MiniFiIoT with Apache MXNet and Apache NiFi and MiniFi
IoT with Apache MXNet and Apache NiFi and MiniFi
 
HTML5 WebSocket Introduction
HTML5 WebSocket IntroductionHTML5 WebSocket Introduction
HTML5 WebSocket Introduction
 
HTML5 Real-Time and Connectivity
HTML5 Real-Time and ConnectivityHTML5 Real-Time and Connectivity
HTML5 Real-Time and Connectivity
 
Case Study for Academics and jobs development Higher Education Community
Case Study for Academics and jobs development Higher Education CommunityCase Study for Academics and jobs development Higher Education Community
Case Study for Academics and jobs development Higher Education Community
 

More from phptechtalk (7)

Errazudin - REST in pieces (with frapi) - Malaysia Open Source Conference 2011
Errazudin - REST in pieces (with frapi) - Malaysia Open Source Conference 2011Errazudin - REST in pieces (with frapi) - Malaysia Open Source Conference 2011
Errazudin - REST in pieces (with frapi) - Malaysia Open Source Conference 2011
 
Slipstream Rapid Application Design
Slipstream Rapid Application DesignSlipstream Rapid Application Design
Slipstream Rapid Application Design
 
Zend In The Cloud
Zend In The CloudZend In The Cloud
Zend In The Cloud
 
Php In The Enterprise 01 24 2010
Php In The Enterprise 01 24 2010Php In The Enterprise 01 24 2010
Php In The Enterprise 01 24 2010
 
P Hundamental Security Coding Secure With Php Lamp
P Hundamental Security Coding Secure With Php LampP Hundamental Security Coding Secure With Php Lamp
P Hundamental Security Coding Secure With Php Lamp
 
Zend Solutions For Operational Maturity 01 21 2010
Zend Solutions For Operational Maturity 01 21 2010Zend Solutions For Operational Maturity 01 21 2010
Zend Solutions For Operational Maturity 01 21 2010
 
Enabling The Enterprise With Php
Enabling The Enterprise With PhpEnabling The Enterprise With Php
Enabling The Enterprise With Php
 

Recently uploaded

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Recently uploaded (20)

2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 

Making Joomla! site fly with nginx : Joomla! day Malaysia 2011

  • 1. Joomla! Day Malaysia 2011 Making Joomla! Site fly with Nginx Errazudin Ishak www.mimos.my © 2009 MIMOS Berhad. All Rights Reserved.
  • 2. Agenda • Me • Joomla! • “engine X” • Benchmarks • Samples www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 3. About Me • Errazudin Ishak • @errazudin • Senior engineer @ Mimos Bhd Malaysia • Focuses on web application development, deployment, performance and stability. • 2009 : foss.my , MyGOSSCON • 2010 : Entp. PHP Techtalk, BarcampKL, PHP Meetup, MOSC2010, PHP Northwest UK, MyGOSSCON • 2011 : INTAN Tech Update, Wordpress Conf. Asia www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 4. www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 5. Joomla! 23.5mil *downloads Techcrunch June 11th; http://goo.gl/DTveS www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 6. Joomla! 1.6 +2.5mil *downloads Techcrunch June 11th; http://goo.gl/DTveS www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 7. www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 8. nginx • Free • X platform • open-source • (high-performance) • lightweight • HTTP server • reverse proxy • IMAP/POP3 proxy server www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 9. http://commons.wikimedia.org/wiki/File:Whittle_Jet_Engine_W2-700.JPG “I'm the author of nginx (pronounced "engine x")- Igor Sysoev (nginx creator) www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 10. http://www.litchfieldimports.co.uk/forum/gtr-engine-bay.jpg Load Balance Static Content, Index files Reverse Proxy (with cache) Streaming www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 11. http://noisetu.be/mirrors/jet_beetle/ Loads of Request Less memory footprint Use less CPU C10K Certified www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 12. http://www.gtrblog.com/wp-content/uploads/2008/11/gtr-gt2-nurburgring-001.jpg Apache ---------- -------- Processes Async model Threads Single Thread High Memory Low Memory CPU Overhead Less CPU PHP included as PHP as separate proc. module (mod_php) over FastCGI www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 13. Boston.com Numbers www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 14. Market Share for Top Servers Across All Domains Source : Netcraft www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 15. Market Share for Top Servers Across All Domains Source : Netcraft www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 16. Market Share for Top Servers Across the Million Busiest Sites Source : Netcraft www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 17. Market Share for Top Servers Across the Million Busiest Sites Source : Netcraft www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 18. http://goo.gl/KJC8H Who? www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 19. Me uses nginx www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 20. Me uses nginx www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 21. We also.. www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 22. We all love nginx… www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 23. Modules Mail, 3rd Party Optional HTTP Standard HTTP Core www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 24. Modules Mail Core, Mail Auth, Mail Proxy, Mail SSL HTTP Addition, Emb. Perl, FLV, Gzip Precompression, Random Index, GeoIP, Real IP, SSL, Stub Status, Substitution, WebDAV, Google Perftools, XSLT, Secure Link, Image Filter HTTP Core, HTTP Upstream, HTTP Access, HTTP Auth Basic, HTTP Auto Index, Browser, Charset, Empty gif, FastCGI, Geo, Gzip, HTTP Headers, Index, HTTP Referer, HTTP Limit Zone, HTTP Limit Requests, Log, Map, Memchached, HTTP Proxy, Rewrite, SSI, User ID Main, Events www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 25. Nginx with PHP • FastCGI • PHP-FPM (FastCGI Process Manager) • Bundled with PHP 5.3.3 www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 26. Nginx with PHP : FastCGI • persistent processes, ability to handle multiple requests. • web server and gateway application communicate with sockets such as TCP • web server forwards the client request to the gateway and receives the response within a single connection • can be implemented on any platform with any programming language. www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 27. Nginx with PHP : FastCGI server { server_name mysite.com; listen 80; root /usr/share/mysite/www; index index.html; location / { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include fastcgi_params; } } www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 28. Nginx with Joomla! server { server_name yourdomain.com; large_client_header_buffers 4 8k; root /var/www/joomla; index index.php index.html; location / { try_files $uri $uri/ /index.php?q=$request_uri; } location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 29. PHP-FPM • FastCGI Process Manager • Daemonizes PHP > background proc • provides a command-line script for managing PHP proc • configuration of FastCGI pools • enhances some of the FastCGI internals • increases error reporting • script termination www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 30. Benchmarks http://www.myshutterspace.com/profile/AthonySaucedo www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 31. Benchmark : Specs • Intel Core Duo • T2400, 1.83 GHz • 2GB RAM • OS- Fedora 12 www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 32. Benchmark : apacheBench • -n 100 • -c 20 www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 33. Benchmark : nginx www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 34. Benchmark : apache www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 35. Benchmark : Findings Apache 2.2.15 Nginx 0.7.67 Concurrency 20 20 Doc size 674600bytes 658000bytes Complete 100% 100% Request Req per secs 7.2 8.8 Longest Req 4848ms 2638ms www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 36. Benchmark : apacheBench • -n 500 • -c 50 www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 37. Benchmark : nginx www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 38. Benchmark : apache www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 39. Benchmark : Findings Apache 2.2.12 Nginx 0.7.62 Concurrency 50 50 Doc size 3373300 bytes 3290000 bytes Complete 100% 100% Request Req per secs 7.93 8.47 Longest Req 12154 ms 6374 ms www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 40. Benchmark : apacheBench • -n 1000 • -c 100 www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 41. Benchmark : nginx www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 42. Benchmark : apache www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 43. Benchmark : Findings Apache 2.2.12 Nginx 0.7.62 Concurrency 100 100 Doc size 6746000 bytes 6580000 bytes Complete 100% 100% Request Req per secs 7.91 8.48 Longest Req 19268 ms 12196 ms www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 44. http://goo.gl/4SAnf “Every nanoseconds count!” - My Big Boss (your boss also) www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 45. http://goo.gl/xmdsy Demo www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 46. Resources • http://wiki.nginx.org/Main • Nedelcu’s book http://goo.gl/67OA • Nginx 1 Web Server Implementation Cookbook http://goo.gl/46UYq • http://php-fpm.org/ • http://nginx.org www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.
  • 47. THANK YOU @errazudin errazudin.ishak@mimos.my errazudin.ishak@gmail.com * All images, logos and data are the copyright of their respective owners www.mimos.my © 2011 MIMOS Berhad. All Rights Reserved.