![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
nginx
小边3310903
Php, Android, Fe....
展开
-
nginx--worker_processes压测文档
注:服务是nginx+lua,在lua层有大量的业务逻辑,使用ab压测的,在公司虚拟化机器压测的,数据只做参考cpu信息:两个逻辑核2个worker压测配置:worker_processes 2;worker_cpu_affinity 01 10;并发500压测数据:Concurrency Level: 500Time taken for tests:...原创 2019-08-08 11:31:13 · 343 阅读 · 0 评论 -
nginx-- lua cache、lua相关的代码压测
配置信息:机器:物理机、cpu 2个物理核、64个逻辑核配置:nginx配置8个worker压测工具:locustlua_code_cache off压测数据lua_code_cache on压测数据lua_code_cache配置对服务器的性能影响还是很大的,从压测数据来看开启后能提高4倍左右的吞吐。lua中只输出一句hello world,看看ngin...原创 2019-08-08 15:12:29 · 561 阅读 · 0 评论 -
nginx--变量的作用域
问题:这两种引用的区别local xxx = require('xxx') require('xxx')原因分析:nginx的全局变量生命周期是和请求的生命周期一致,每个子请求有自己的全局变量。xxx模块是在第一次请求时会被初始化并缓存在内置的package.loaded表中,方便后续引用。全局变量将在请求结束时被清空,当子请求在访问全局变量xxx时因为xxx不在当前的全局变量中而...原创 2019-08-07 16:43:53 · 1212 阅读 · 0 评论 -
nginx--启动 hup stop执行过程
nginx.conf配置:worker_processes 8;worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;worker_rlimit_nofile 204800;error_log /home/work/orp/log/error_log...原创 2019-08-07 18:22:59 · 653 阅读 · 0 评论 -
nginx-- 利用set_by_lua进行优化
背景服务是采用nginx+lua实现的,在nginx的配置中存在多处(共20多处)正则判断,期望进行优化location ~* /test.gif { rewrite_by_lua_file 'lua/edit.lua'; if ($query_string ~* "pd=8(&|$)") { set $req_host inner.a.com;...原创 2019-09-03 15:28:56 · 7425 阅读 · 0 评论