startyourenginenginx-errazudin
TRANSCRIPT
-
8/9/2019 StartyourengineNginx-Errazudin
1/33
www.mimos.my 2009 MIMOS Berhad. All Rights Reserved.
Gentlemen,
Start Your Nginx!
(, Nginx!)
Errazudin Ishak
-
8/9/2019 StartyourengineNginx-Errazudin
2/33
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
http://www.speksnk.org/foro/viewtopic.php?f=50&t=66973
-
8/9/2019 StartyourengineNginx-Errazudin
3/33
me engine X
nginx.conf
..with PHP
Benchmark
Samples
Agenda
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
4/33
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Nginx is your new hammer, and everything is a nail! -
Jeff Griffiths(web hacker and Drupal enthusiast at dimeRocker)
http://www.flickr.com/photos/george_eastman_house/2870348715/sizes/o/
-
8/9/2019 StartyourengineNginx-Errazudin
5/33
Senior engineer @Mimos Bhd
Currently involved in a team of eating, drinking
and sleeping with PHP in developing web based
solutions.
Framework, platform, Unit test , CI, performance 2009 : foss.my , MyGOSSCON
2010 : Entp. PHP Techtalk, BarcampKL, PHP
Meetup
Me
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
6/33
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
7/33
Free X platform
open-source
(high-performance)
lightweight
HTTP server reverse proxy
IMAP/POP3 proxy server
nginx
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
8/33www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
I'm the author of nginx (pronounced "engine x")-
Igor Sysoev(nginx creator)
http://noisetu.be/mirrors/jet_beetle/
-
8/9/2019 StartyourengineNginx-Errazudin
9/33www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Load Balance
Static Content, Index files
Reverse Proxy (with cache)
Streaming
http://commons.wikimedia.org/wiki/File:Whittle_Jet_Engine_W2-700.JPG
-
8/9/2019 StartyourengineNginx-Errazudin
10/33www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Loads of Request
Less memory footprint
Use less CPU
C10K Certified
http://noisetu.be/mirrors/jet_beetle/
// / / /
-
8/9/2019 StartyourengineNginx-Errazudin
11/33www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Apache
----------
Processes
Threads
High Memory
CPU OverheadPHP included as
module (mod_php)
http://noisetu.be/mirrors/jet_beetle/
--------
Async model
Single Thread
Low Memory
Less CPU
PHP as separate proc.
over FastCGI
-
8/9/2019 StartyourengineNginx-Errazudin
12/33www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Numbers
http://www.zerotohundred.com/newforums/engine-and-performance/305020-nrg-racing-meters-9.html
-
8/9/2019 StartyourengineNginx-Errazudin
13/33
Market Share for Top Servers Across All Domains
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Source :
Netcraft
-
8/9/2019 StartyourengineNginx-Errazudin
14/33
Market Share for Top Servers Across the Million Busiest
Sites
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Source :
Netcraft
http://noisetu be/mirrors/jet beetle/
-
8/9/2019 StartyourengineNginx-Errazudin
15/33www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Who?
http://noisetu.be/mirrors/jet_beetle/
-
8/9/2019 StartyourengineNginx-Errazudin
16/33
Me uses nginx
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
17/33
We also..
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
18/33
We all love nginx
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
19/33
Modules
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Mail, 3
rd
Party
Optional
HTTP
Standard
HTTP
Core
-
8/9/2019 StartyourengineNginx-Errazudin
20/33
Modules
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Main, Events
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
HTTP Addition, Emb. Perl, FLV, Gzip Precompression, Random Index,
GeoIP, Real IP, SSL, Stub Status, Substitution, WebDAV, Google Perftools,
XSLT, Secure Link, Image Filter
Mail Core, Mail Auth, Mail Proxy, Mail SSL
-
8/9/2019 StartyourengineNginx-Errazudin
21/33www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Nginx is a HTTP Router - Adam Wiggins
(Ruby hacker, entrepreneur, libertarianRailsConf08)
-
8/9/2019 StartyourengineNginx-Errazudin
22/33
FastCGI Spawn-fcgi (wrapper)
PHP-FPM (FastCGI Process Manager)
Nginx with PHP
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
23/33
FastCGI Process Manager configuration of FastCGI pools
enhances some of the FastCGI internals
increases error reporting
script termination
PHP-FPM
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
24/33www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Benchmark
http://www.myshutterspace.com/profile/AthonySaucedo
-
8/9/2019 StartyourengineNginx-Errazudin
25/33
AMD Turion 64 1MB L2 Cache, 1.8 GHz
1GB RAM
OS- Karmic Koala
(my old 4 y.o. Acer)
Benchmark : Specs
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
26/33
-n 5000 -c 500
Benchmark : apacheBench
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
27/33
Benchmark : nginx
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
28/33
Benchmark : apache (runs..)
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
29/33
Benchmark : apache (end)
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
-
8/9/2019 StartyourengineNginx-Errazudin
30/33
Benchmark : Findings
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Apache 2.2.12 Nginx 0.7.62
Concurrency 500 500
Doc size 2195 bytes 2195 bytes
Complete Request 100% 100%
Req per secs 327 3003
Longest Req 15269ms 296ms
-
8/9/2019 StartyourengineNginx-Errazudin
31/33
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Every nanoseconds count! - My Big Boss(your boss also)
http://www.flickr.com/photos/20509716@N00/4162719773/sizes/m/
http://www.greenpeace.org/australia/solutions/
-
8/9/2019 StartyourengineNginx-Errazudin
32/33
www.mimos.my 2010 MIMOS Berhad. All Rights Reserved.
Lets Rawk. Demo time..
-
8/9/2019 StartyourengineNginx-Errazudin
33/33
THANK YOU@errazudin