我使用Passenger和Nginx将我的应用程序部署到Digitalocean。我使用apache bench来查看我可以在静态页面上获得的每秒请求数量(简单的hello world rails视图),但我只获得4个请求/秒。
ab -n 100 http://107.170.100.242/fo
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.8.0
Server Hostname: 107.170.100.242
Server Port: 80
Document Path: /fo
Document Length: 5506 bytes
Concurrency Level: 1
Time taken for tests: 22.662 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 632600 bytes
HTML transferred: 550600 bytes
Requests per second: 4.41 [#/sec] (mean)
Time per request: 226.617 [ms] (mean)
Time per request: 226.617 [ms] (mean, across all concurrent requests)
Transfer rate: 27.26 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 181 226 65.4 204 445
Waiting: 181 226 65.4 204 445
Total: 181 227 65.4 204 446
因为我正在使用Nginx,所以应该是每秒几千。我一整天都在研究这个没有结果,有人可以指导我走正确的道路来解决这个问题吗?
答案 0 :(得分:0)
这将是nginx配置指令,它将导致它绕过应用服务器并直接提供静态文件:
root /var/www/my_app/public;
你确定这是对的吗?