More Related Content
Similar to Making Joomla! site fly with nginx : Joomla! day Malaysia 2011 (20)
More from phptechtalk (7)
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.
- 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.
- 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.
- 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.
- 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.
- 31. Benchmark : Specs
• Intel Core Duo
• T2400, 1.83 GHz
• 2GB RAM
• OS- Fedora 12
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.
- 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.
- 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.
- 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.