<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
w3wsrmn wrote:
<blockquote
 cite="mid:962e8bb041a010b4f5c44bcae12fdfe9.NginxMailingList@forum.nginx.org"
 type="cite">
  <pre wrap="">Howdy,

For cases when large files are served via FastCGI, what might be the ideal settings for the "fastcgi_buffers" directive, in order to prevent the warning:
"an upstream response is buffered to a temporary file /usr/local/nginx/fastcgi_temp/0/00/0000000000 while reading upstream" ?

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


Or does it not matter which method is used?</pre>
</blockquote>
It would be better to tell nginx to serve the file rather than have an
upstream/fastcgi program serve it - nginx can generally handle many,
many more connections than your fast-cgi backend so try and make nginx
do as much of the work as possible.<br>
<br>
Take a look at: <a href="http://wiki.nginx.org/NginxXSendfile">http://wiki.nginx.org/NginxXSendfile</a>
- using this means your PHP/fast-cgi thread can exit once it's returned
the header and then move on to accept another connection.<br>
<br>
<div class="moz-signature">-- <br>
<div
 style="font-family: sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 1.1; font-size-adjust: none; font-stretch: normal; width: 300px; color: rgb(51, 51, 51);">
<p><strong>Phillip B Oldham</strong><br>
ActivityHQ<br>
<a href="mailto:phill@theactivitypeople.co.uk">phill@activityhq.com</a></p>
<hr size="1">
<p style="font-size: 90%;"><strong>Policies</strong></p>
<p style="font-size: 90%;">This e-mail and its attachments are intended
for the above named recipient(s) only and may be confidential. If they
have come to you in error, please reply to this e-mail and highlight
the error. No action should be taken regarding content, nor must you
copy or show them to anyone.</p>
<p style="font-size: 90%;">This e-mail has been created in the
knowledge that Internet e-mail is not a 100% secure communications
medium, and we have taken steps to ensure that this e-mail and
attachments are free from any virus. We must advise that in keeping
with good computing practice the recipient should ensure they are
completely virus free, and that you understand and observe the lack of
security when e-mailing us.</p>
<hr size="1">
</div>
</div>
</body>
</html>