tail –f一段时间后,监视 apache 日志往往会让眼睛感到非常沮丧。是否有任何工具/选项可以为日志输出着色?也许用红色等信号表示致命...
我提供了一个 wordpress 博客,其中 nginx http 缓存到超过 99% 的请求,缓存寿命为 2 天。这是该网站的网页。网页有很多图像,因此延迟加载。页面的平均大小仅为 1 mb。
平均响应大小为 10 KB
使用速度曲线时,我的 TTFB 中位数为 0.6 秒
为什么这么高?
我支持 cloudflare,所有静态资产(如 JS、CSS 和图像)都从 cloudflare 进行版本控制和缓存。
我的 nginx 配置有
sendfile on;
# https://forum.nginx.org/read.php?2,280434,280434#msg-280434
tcp_nopush on;
tcp_nodelay on;
#https://support.cloudflare.com/hc/en-us/articles/212794707-General-Best-Practices-for-Load-Balancing-at-your-origin-with-Cloudflare
#https://www.nginx.com/blog/tuning-nginx/
keepalive_timeout 300s;
keepalive_requests 10000;
Run Code Online (Sandbox Code Playgroud)
我也有
initcwnd 设置为 10,initrwnd 10 和 ipv4.tcp_slow_start_after_idle=0
这是 cloudflare 对从 CF 到源的响应时间的报告

静态网站也在两台机器上进行负载平衡。一个在弗里蒙特,一个在孟买,Cloudflare 做地理路由。
为什么我的 TTFB 这么长,我可以做些什么来减少它?
linux ×2
console ×1
firmware ×1
http-caching ×1
logging ×1
monitoring ×1
nagios ×1
nginx ×1
performance ×1
router ×1
tail ×1