我使用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。我已经研究了一整天都没有结果,有人能告诉我解决这个问题的正确途径吗?
发布于 2015-06-13 10:36:19
这将是nginx config指令,它将使其绕过应用程序服务器,直接提供静态文件:
root /var/www/my_app/public; 你确定这是对的吗?
https://stackoverflow.com/questions/30814435
复制相似问题