Best way to benchmark my site

22 views
Skip to first unread message

Chris Carpenter

unread,
Mar 13, 2015, 3:27:51 PM3/13/15
to phusion-...@googlegroups.com
So I am new to passenger and I am trying to make sure I am getting optimal performance before going live with the site.

In the Optimization Guide from passenger they recommended using wrk to test the site. I installed it and tested against my site and the numbers look abysmal to say the least. I thought the Requests/sec would be a lot higher.

chris@ubuntu14:~$ wrk -t12 -c50 -d30s http://mynewsite
Running 30s test @ http://mynewsite
  12 threads and 50 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   218.35ms  101.82ms 413.71ms   58.33%
    Req/Sec    17.50      0.52    18.00    100.00%
  4814 requests in 30.00s, 87.95MB read
  Socket errors: connect 0, read 0, write 0, timeout 128
Requests/sec:    160.44
Transfer/sec:      2.93MB

I figured that this setup would yield a higher throughput.

All servers at Digital Ocean

1 Load Balancer (haproxy) 2GB Ram / 2 CPU

2 Web Servers (Nginx, Passenger Enterprise) 8GB Ram / 4 CPU


The CPU usage on the load balancer hovers around 40% when testing, but both the web servers CPUs spike to 100% usage the entire time. Its just hard to believe that 50 connections is utilizing 100% CPU usage on two servers. Here is a snippet of my nginx.conf for both servers.

passenger_max_pool_size 7;
passenger_min_instances 7;
passenger_pre_start http://mynewsite/;

Any ideas of why this looks so bad? Are my ruby process supposed to be using 100% CPU usage when I get 50 users on the site?

EDIT: Using passenger enterprise 5.0.4 and nginx 1.6.2

Hongli Lai

unread,
Mar 16, 2015, 5:36:26 AM3/16/15
to phusion-passenger
If you use Rails, that number looks about right. Rails saturates your
CPU at about this many requests/sec. There are a few tweaks you can
make in the app server, such as using the builtin engine (also
documented in the Server Optimization Guide), but most of the time is
spent in the app itself. Optimizing the app will have the biggest
effect.

One notable exception is Passenger's turbocache, which can speed up
your app tremendously:
https://www.phusionpassenger.com/documentation/ServerOptimizationGuide.html#header_11
> --
> You received this message because you are subscribed to the Google Groups
> "Phusion Passenger Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phusion-passen...@googlegroups.com.
> To post to this group, send email to phusion-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/phusion-passenger.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phusion-passenger/e98f574c-6f61-47b7-86b8-9e5bf163bf62%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)
Reply all
Reply to author
Forward
0 new messages