随笔分类 - 负载均衡-nginx
摘要:笔者在根据nginx的accesslog中$request_time进行程序优化时,发现有个接口,直接返回数据,平均的$request_time也比较大。原来$request_time包含了用户数据接收时间,而真正程序的响应时间应该用$upstream_response_time。 下面介绍下2者的
阅读全文
摘要:ngx_lua 模块 https://segmentfault.com/a/1190000012233483 nginx lua重置请求参数及常量备忘 Lua_Nginx_API Lua_Nginx_API ngx_lua模块的原理: 1、每个worker(工作进程)创建一个Lua VM,worke
阅读全文
摘要:环境介绍 服务器:centos6.4服务:nginx proxy 问题描述: 然后查找 /opt/usr/nginx/1.4.0/logs 错误 error.log日志提示如下 2015/01/04 15:44:13 [error] 10112#0: *994662 upstream timed o
阅读全文
摘要:模块是 HttpUpstreamModule,配置的一个例子: [shell]upstream http_backend { server 127.0.0.1:8080; keepalive 16;}server { … location /http/ { proxy_pass http://htt
阅读全文
摘要:一、在http header上增加命中显示 nginx提供了$upstream_cache_status这个变量来显示缓存的状态,我们可以在配置中添加一个http头来显示这一状态,达到类似squid的效果。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1
阅读全文
摘要:nginx缓存设置proxy_cache http://www.cnblogs.com/dudu/p/4597351.html http块: proxy_cache_path /tmp/cache levels=1:2 keys_zone=nuget-cache:20m max_size=50g i
阅读全文
摘要:文章转载于:http://9388751.blog.51cto.com/9378751/1676821 nginx优化 突破十万并发 一、一般来说nginx 配置文件中对优化比较有作用的为以下几项: 1. worker_processes 8; nginx 进程数,建议按照cpu 数目来指定,一般为
阅读全文