I just moved our blog-network to ngnix (from apache) which is powered by WPMU. Everything is running smoothly and fine.
During my quest to optimize server to the max level - I came across this thread on nginx forum http://forum.nginx.org/read.php?2,2649
I would really like to know: Answer to the original question...
For example, to prevent the warning when serving a 6144 kilobyte file, which of the three methods would yield the best performance?
- A large number of small buffers: fastcgi_buffers 768 8k
- A small number of large buffers: fastcgi_buffers 8 768k
- A near balance between the buffers and size: fastcgi_buffers 64 96k
And also one more thing: In my ngnix.config - my setting is:
fastcgi_buffers 64 4k;
i.e. 256K buffer size (I am on 32-bit platform). Does this mean if my PHP scripts generates response larger than 256K, nginx will throw some error?
I know ngnix forum seems better place to ask this but as no ngnix forum is more active than serverfault, I'm posting this question here.
I hope I will get some inputs/guidance from experts here.
Thanks,
-Rahul
No, it means that if your scripts often generate less than 256K responses - the buffer will often be half-empty, and you just waste the memory :)
Beffer works like this: nginx reads
min(buffer_size,response_size)
bytes from FCGI script, sends it to a client and empties the buffer's contents. If there's more responce data - it reads & sends again.If your site often provides small script-generated pages, the optimal value is a bit more than the size of a typical script responce size: headers + contents.