Benchmarking a rails app running Nginx+passenger on a 2g VPS

20 views
Skip to first unread message

ahmad pepe

unread,
Jun 12, 2015, 4:38:42 PM6/12/15
to phusion-...@googlegroups.com
Hi,

I ran apache benchmark with my app and here are the results : 

ab -n 10 http://107.170.100.242:3000/

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/


Benchmarking 107.170.100.242 (be patient).....done



Server Software:        nginx/1.6.3

Server Hostname:        107.170.100.242

Server Port:            3000


Document Path:          /

Document Length:        5549 bytes


Concurrency Level:      1

Time taken for tests:   2.775 seconds

Complete requests:      10

Failed requests:        0

Write errors:           0

Total transferred:      63670 bytes

HTML transferred:       55490 bytes

Requests per second:    3.60 [#/sec] (mean)

Time per request:       277.534 [ms] (mean)

Time per request:       277.534 [ms] (mean, across all concurrent requests)

Transfer rate:          22.40 [Kbytes/sec] received


Connection Times (ms)

              min  mean[+/-sd] median   max

Connect:        0    0   0.1      0       0

Processing:   190  277 101.2    282     442

Waiting:      190  277 101.0    282     441

Total:        190  277 101.3    282     442


I increased the concurrency : 


 ab -n 100 -c 10 http://107.170.100.242:3000/

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/


Benchmarking 107.170.100.242 (be patient).....done



Server Software:        nginx/1.6.3

Server Hostname:        107.170.100.242

Server Port:            3000


Document Path:          /

Document Length:        5549 bytes


Concurrency Level:      10

Time taken for tests:   15.348 seconds

Complete requests:      100

Failed requests:        0

Write errors:           0

Total transferred:      636700 bytes

HTML transferred:       554900 bytes

Requests per second:    6.52 [#/sec] (mean)

Time per request:       1534.800 [ms] (mean)

Time per request:       153.480 [ms] (mean, across all concurrent requests)

Transfer rate:          40.51 [Kbytes/sec] received


Connection Times (ms)

              min  mean[+/-sd] median   max

Connect:        0    0   0.2      0       1

Processing:   498 1497 672.5   1250    3716

Waiting:      497 1496 672.3   1245    3715

Total:        499 1497 672.5   1250    3716


Percentage of the requests served within a certain time (ms)

  50%   1250

  66%   1375

  75%   1624

  80%   1997

  90%   2585

  95%   3329

  98%   3514

  99%   3716

 100%   3716 (longest request) 


I get only 6 requests/s . 


Is this Normal? Is there some configuration I have to do ? 


Thanks

Daniel Knoppel

unread,
Jun 13, 2015, 4:04:40 AM6/13/15
to phusion-...@googlegroups.com
See the server optimization guide: https://www.phusionpassenger.com/documentation/ServerOptimizationGuide.html

I don't know what your app does but for example if you don't allow caching then Passenger can't help speed up the responses.

- Daniel

ahmad pepe

unread,
Jun 13, 2015, 7:53:47 AM6/13/15
to phusion-...@googlegroups.com
Hi Daniel,
I don't allow caching yet, but still I expected more requests/s from passenger giving I am hitting a page with only one sql statement. 

Daniel Knoppel

unread,
Jun 13, 2015, 8:54:47 AM6/13/15
to phusion-...@googlegroups.com
It only takes 1 slow SQL statement to make an app. slow ;) 

Passenger doesn't have much to do with SQL queries. If the database is the bottleneck you could improve the query, or allow caching to avoid the query as much as possible. Increasing the pool size may help if parallelized queries are faster.

- Daniel
Reply all
Reply to author
Forward
0 new messages