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配置应该算是很熟悉了,自动化的配置脚本也写过,

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

About mrhaigui

激烈的理想主义者...需提防蜕变为彻底的虚无主义者...
This entry was posted in nginx. Bookmark the permalink.

One Response to proxy_temp_path

  1. Pingback: 456

留下评论

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>