检查nginx日志;
有报错信息:
......
2022/07/19 10:30:59 [warn] 1928#1928: *1215 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/2/02/0000000022 while reading upstream, client: 123.123.220.114, server: 51epub.cc, request: "GET / HTTP/2.0", upstream: "http://127.0.0.1:8088/", host: "51epub.cc", referrer: "https://51epub.cc/archives/7975.html"
2022/07/19 10:31:10 [error] 1928#1928: *1148 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 112.234.107.146, server: 51epub.cc, request: "GET /archives/7996.html HTTP/2.0", upstream: "http://127.0.0.1:8088/archives/7996.html", host: "51epub.cc", referrer: "https://51epub.cc/categories/book01"
初步分析: 我发现很多的访问 伪静态的配置html页面; nginx都会去缓存找一下, 找不到缓存的时候, 再去请求后端程序, 结果出现超时, 应该是缓存及后端应用程序运行出现了超时;
---------------------------------------------------------------------------------------------------
验证思路1:
1-将halo的伪静态的配置去掉. 再重启halo和nginx试试;
验证结果:
不再报超时错误, 可以访问到post了; 首页和分类页面访问速度很快, 但是依然单个的post访问依然很慢 ( 但是比配置了 伪静态的HTML的访问方式要好很多了 )
分析:
与halo的静态后缀名称配置有一定的关系; 但是关联不大; 还是后端halo运行有问题;
---------------------------------------------------------------------------------------------------
-----
验证思路2:
2-直接通过IP地址访问后端halo; (跳过Nginx代理) ; 看看后端是否报错;
https://106.13.0.140/archives/7984
此时的效果与上面基本相同:
首页和分类页面访问速度很快, 但是依然单个的post访问依然很慢
------------
上面两种思路验证时, 监控应用服务器单机的性能情况都还是良好;