V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
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 · 2014-02-21 09:56:46 +08:00 · 6226 次点击
    这是一个创建于 3688 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 条回复    1970-01-01 08:00:00 +08:00
    est
        1
    est  
       2014-02-21 10:08:39 +08:00
    http://en.wikipedia.org/wiki/Page_(computer_memory)

    proxy_buffers 满了不射,就会阻塞。
    flytwokites
        2
    flytwokites  
    OP
       2014-02-21 10:14:13 +08:00
    @est 具体什么意思?

    size为8K,nginx收到头2K时应该同时已经在往客户端发了吧?不会傻等8K都到齐了再射吧?
    est
        3
    est  
       2014-02-21 10:36:07 +08:00
    @flytwokites

    这么理解好了。

    buffer 就是京东的仓库。 你买异地仓库东西,假如本地仓库容量为4,如果同时5个人买,那么肯定是第一批4个人移仓完毕了送货完毕了,才会开始第五个人的移仓。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2514 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 705ms · UTC 16:01 · PVG 00:01 · LAX 09:01 · JFK 12:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.