NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
flytwokites
V2EX  ›  NGINX

nginx 的 proxy_buffers 到底是什么意思?为什么有大小和块数?而不是一大块?

  •  
  •   flytwokites · Feb 21, 2014 · 7263 views
    This topic created in 4487 days ago, the information mentioned may be changed or developed.
    nginx的文档很操蛋,就一句话:

    Syntax:
    proxy_buffers number size

    This directive sets the number and the size of buffers, into which will be read the answer, obtained from the proxied server. By default, the size of one buffer is equal to the size of page. Depending on platform this is either 4K or 8K.

    这个size是指*单个*请求的最大缓存吗?比如一个文件有10M,那设置size为4K的话是不是就只缓存了头4K,其它就用硬盘来缓存了?
    还有这个number,指的是同时最有多number个请求可以缓存吗?
    3 replies    1970-01-01 08:00:00 +08:00
    est
        1
    est  
       Feb 21, 2014
    http://en.wikipedia.org/wiki/Page_(computer_memory)

    proxy_buffers 满了不射,就会阻塞。
    flytwokites
        2
    flytwokites  
    OP
       Feb 21, 2014
    @est 具体什么意思?

    size为8K,nginx收到头2K时应该同时已经在往客户端发了吧?不会傻等8K都到齐了再射吧?
    est
        3
    est  
       Feb 21, 2014
    @flytwokites

    这么理解好了。

    buffer 就是京东的仓库。 你买异地仓库东西,假如本地仓库容量为4,如果同时5个人买,那么肯定是第一批4个人移仓完毕了送货完毕了,才会开始第五个人的移仓。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4917 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 09:42 · PVG 17:42 · LAX 02:42 · JFK 05:42
    ♥ Do have faith in what you're doing.