expression engine + fast-cgi + nginx

Kiswono Prayogo kiswono at gmail.com
Tue Nov 17 15:11:19 MSK 2009


yes, just now i found that nginx was not better than apache.. >_<

Apache2 vs Nginx fair'er test!

The same: Using spawn-fcgi 1.6.2-2 spawning 4 child + v8cgi 20091117,
query from 4 tables in postgresql, real development example coding
script
The diff: apache2-mpm-prefork 2.2.12-1ubuntu2 + libapache2-mod-fastcgi
2.4.6-1 VS nginx 0.8.24-0~ppa1


### Apache2 First, Nginx Last, -c 4 -n 300
sudo /etc/init.d/nginx stop ; sudo /etc/init.d/apache2 start ; ab -c 4
-n 300 http://127.1/uphs-cms/index.sjs ; sudo /etc/init.d/apache2 stop
; sudo /etc/init.d/nginx start ; ab -c 4 -n 300
http://127.1/uphs-cms/index.sjs ;

Time taken for tests:   74.771 seconds         85.420 seconds
Requests per second:    4.01 [#/sec] (mean)    3.51 [#/sec] (mean)
Time per request:       996.953 [ms] (mean)    1138.930 [ms] (mean)
Time per request:       249.238 [ms]           284.733 [ms] (mean,
across all concurrent requests)
Transfer rate:          3827.96 [Kbytes/sec]   3350.71 [Kbytes/sec] received

APACHE +11..

### Nginx First, Apache2 Last, -c 4 -n 300
sudo /etc/init.d/apache2 stop ; sudo /etc/init.d/nginx start ; ab -c 4
-n 300 http://127.1/uphs-cms/index.sjs ; sudo /etc/init.d/nginx stop ;
sudo /etc/init.d/apache2 start ; ab -c 4 -n 300
http://127.1/uphs-cms/index.sjs ;

Time taken for tests:   87.097 seconds         91.375 seconds
Requests per second:    3.44 [#/sec] (mean)    3.28 [#/sec] (mean)
Time per request:       1161.296 [ms] (mean)   1218.328 [ms] (mean)
Time per request:       290.324 [ms]           304.582 [ms] (mean,
across all concurrent requests)
Transfer rate:          3286.18 [Kbytes/sec]   3132.40 [Kbytes/sec] received

NGINX +5..

### Apache2 First, Nginx Last, -c 16 -n 64
sudo /etc/init.d/nginx stop ; sudo /etc/init.d/apache2 start ; ab -c
16 -n 64 http://127.1/uphs-cms/index.sjs ; sudo /etc/init.d/apache2
stop ; sudo /etc/init.d/nginx start ; ab -c 16 -n 64
http://127.1/uphs-cms/index.sjs ;

Time taken for tests:   20.376 seconds         21.050 seconds
Requests per second:    3.14 [#/sec] (mean)    3.04 [#/sec] (mean)
Time per request:       5093.951 [ms] (mean)   5262.544 [ms] (mean)
Time per request:       318.372 [ms]           328.909 [ms] (mean,
across all concurrent requests)
Transfer rate:          2996.73 [Kbytes/sec]   2900.67 [Kbytes/sec] received

APACHE +1..

### Nginx First, Apache2 Last, -c 16 -n 64
sudo /etc/init.d/apache2 stop ; sudo /etc/init.d/nginx start ; ab -c
16 -n 64 http://127.1/uphs-cms/index.sjs ; sudo /etc/init.d/nginx stop
; sudo /etc/init.d/apache2 start ; ab -c 16 -n 64
http://127.1/uphs-cms/index.sjs ;

Time taken for tests:   20.643 seconds         21.055 seconds
Requests per second:    3.10 [#/sec] (mean)    3.04 [#/sec] (mean)
Time per request:       5160.739 [ms] (mean)   5263.868 [ms] (mean)
Time per request:       322.546 [ms]           328.992 [ms] (mean,
across all concurrent requests)
Transfer rate:          2957.89 [Kbytes/sec]   2899.99 [Kbytes/sec] received

NGINX +1..

### Apache2 First, Nginx Last, -c 2 -n 50
sudo /etc/init.d/nginx stop ; sudo /etc/init.d/apache2 start ; ab -c 2
-n 50 http://127.1/uphs-cms/index.sjs ; sudo /etc/init.d/apache2 stop
; sudo /etc/init.d/nginx start ; ab -c 2 -n 50
http://127.1/uphs-cms/index.sjs ;

Time taken for tests:   13.526 seconds         12.732 seconds
Requests per second:    3.70 [#/sec] (mean)    3.93 [#/sec] (mean)
Time per request:       541.050 [ms] (mean)    509.290 [ms] (mean)
Time per request:       270.525 [ms]           254.645 [ms] (mean,
across all concurrent requests)
Transfer rate:          3526.75 [Kbytes/sec]   3746.62 [Kbytes/sec] received

NGINX +1..

### Nginx First, Apache2 Last, -c 2 -n 50
sudo /etc/init.d/apache2 stop ; sudo /etc/init.d/nginx start ; ab -c 2
-n 50 http://127.1/uphs-cms/index.sjs ; sudo /etc/init.d/nginx stop ;
sudo /etc/init.d/apache2 start ; ab -c 2 -n 50
http://127.1/uphs-cms/index.sjs ;

Time taken for tests:   14.858 seconds         14.600 seconds
Requests per second:    3.37 [#/sec] (mean)    3.42 [#/sec] (mean)
Time per request:       594.316 [ms] (mean)    584.007 [ms] (mean)
Time per request:       297.158 [ms]           292.003 [ms] (mean,
across all concurrent requests)
Transfer rate:          3210.61 [Kbytes/sec]   3267.34 [Kbytes/sec] received

APACHE +0..

i guess there are no real winner? >_<

On 11/17/09, sinarababni <1 at sinarabbani.com> wrote:
> hi,
>
> I tried the installing fast-cgi on a very busy expression engine blog
> installation (100,000+ hits/day) and I would end up with way too many cgi
> processes??? However when I tried reverse nginx as reverse proxy over apache
> running php, I get amazing results. Almost all the load (http requests) stay
> on nginx which is amazing to watch :)
>
> I used standard configurations found on wiki.nginx.org
>
> any experiences or ideas?
>
>
>
>


-- 
--

Regards,
Kiswono P
GB





More information about the nginx mailing list