set `lua_code_cache on;` in server scope.
On Sunday, September 11, 2016 at 11:48:06 AM UTC+8, 兴旺徐 wrote:
刚开始接触openrestry,按照官网上的介绍安装完之后,
新建了一个 server 。配置如下:worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
location / {
default_type text/html;
content_by_lua '
ngx.say("Hello World!")
';
}
}
}
机器配置:
4核CPU + 8G 内存
同机房压并发 10,压测 60 秒的结果如下:
356072 fetches, 10 max parallel, 4.62894e+06 bytes, in 60 seconds
13 mean bytes/connection
5934.53 fetches/sec, 77148.9 bytes/sec
msecs/connect: 0.430664 mean, 19.171 max, 0.15 min
msecs/first-response: 1.1966 mean, 19.418 max, 0.223 min
HTTP response codes:
code 200 -- 356072
与 另外一个提供相同服务的 nginx + php5 的压测结果相比,并没有官网上那么明显:
195095 fetches, 10 max parallel, 2.53624e+06 bytes, in 60 seconds
13 mean bytes/connection
3251.58 fetches/sec, 42270.6 bytes/sec
msecs/connect: 0.315274 mean, 28.312 max, 0.173 min
msecs/first-response: 2.70513 mean, 30.865 max, 0.574 min
HTTP response codes:
code 200 -- 195095
怎么去定位 openrestry 性能提升的瓶颈点呢?