首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Nginx + passenger为一个静态页面服务4个请求/秒

Nginx + passenger为一个静态页面服务4个请求/秒
EN

Stack Overflow用户
提问于 2015-06-13 10:11:06
回答 1查看 104关注 0票数 1

我使用Passenger和Nginx将我的应用程序部署到Digitalocean。我使用apache bench查看了在静态页面上每秒可以收到多少请求(简单的hello world rails视图),但我只收到了4个请求/秒。

代码语言:javascript
运行
复制
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。我已经研究了一整天都没有结果,有人能告诉我解决这个问题的正确途径吗?

EN

回答 1

Stack Overflow用户

发布于 2015-06-13 10:36:19

这将是nginx config指令,它将使其绕过应用程序服务器,直接提供静态文件:

代码语言:javascript
运行
复制
root /var/www/my_app/public; 

你确定这是对的吗?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30814435

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档