proxy - How many nginx buffers is too many? -
reading nginx documentation, proxy_buffer
command has explanatory message:
this directive sets number , size of buffers, read answer, obtained proxied server. default, size of 1 buffer equal size of page. depending on platform either 4k or 8k.
the default 8 4k or 8k buffers. why did authors of nginx
choose eight, , not higher number? go wrong if add more buffers, or bigger buffer size?
nginx built efficient memory , default configurations light on memory usage. nothing go wrong if add more buffers, nginx consume more ram.
eight buffers chosen smallest effective count square of two. 4 few, , 16 greater default needs of nginx.
the “too many buffers” answer depends on performance needs, memory availability, , request concurrency. “good” threshold stay under point @ server has swap memory disk. “best” answer is: few buffers necessary ensure nginx never writes disk (check error logs find out if is).
here nginx configurations use large php-fpm application on web hosts 32 gb of ram:
client_body_buffer_size 2m; client_header_buffer_size 16k; large_client_header_buffers 8 8k; fastcgi_buffers 512 16k; fastcgi_buffer_size 512k; fastcgi_busy_buffers_size 512k;
these configurations determined through trial , error , increasing values nginx configuration guides around web. header buffers remain small because http headers tend lightweight. client , fastcgi buffers have been increased deal complex html pages , xml api.
Comments
Post a Comment