proxy_temp_path

proxy_temp_path

syntax: proxy_temp_path dir-path [ level1 [ level2 [ level3 ]  ;

default: $NGX_PREFIX/proxy_temp controlled by –http-proxy-temp-path at ./configure stage

context: http, server, location

This directive works like client_body_temp_path to specify a location to buffer large proxied requests to the filesystem.

因为业务需要用nginx的proxy_store做了部分图片的cache

但是后来发现proxy_temp_path的目录巨大,这个临时目录当时没有设置2级目录,导致一段时间以后这个目录下文件数量巨多,

这样会照成每次stat目录和find文件都会耗费大量io

改正之:

“proxy_temp_path /data/ngxtemp$date_now 1 2 ;”

今天在例会中经老大提示,才明白这里也是一个优化的地方,

在这里是没注意这个变量,对nginx配置应该算是很熟悉了,自动化的配置脚本也写过,

就是不敢于去推翻以前的东西,才导致在优化提速的历程中裹足不前。

一条评论 发表在“proxy_temp_path”上

  1. 456 说:

    Olga

    Otkuda material ?

留下回复