nginx high i/o
mdounin at mdounin.ru
Sat Nov 21 04:04:14 MSK 2009
On Sat, Nov 21, 2009 at 01:39:38AM +0100, Stefanita Rares Dumitrescu wrote:
> actually i got a bunch of errors, in error log, as i enabled it to
> get some idea on what's going on:
> 2009/11/21 08:47:44 [warn] 24393#0: *57036 an upstream response is
> buffered to a temporary file
> /var/tmp/nginx/fastcgi_temp/1/56/0024741561 while reading upstream,
> i am so sleepy right now, could you please tell me where do i get
> the fastcgi buffers optimizations ? i searched on the wiki but i
> can't think straight.
Start from tuning fastcgi_buffers:
If you haven't had enough memory to deligate it for buffers you
may consider using fastcgi_max_temp_file_size 0; - this will
disable disk buffering at cost of not reading data from backend
connection (i.e. keeping backend busy).
You may also consider investigating why your backend replies are
so big (fastcgi_buffers should be 64k in total on your platform,
this is much more than typical generated html...) and moving them
to nginx itself if possible (e.g. by using X-Accel-Redirect).
> Maxim Dounin wrote:
> >On Sat, Nov 21, 2009 at 12:21:52AM +0100, Stefanita Rares Dumitrescu wrote:
> >>hi guys,
> >>i have posted a question a while ago, and now i am coming back once more.
> >>i have now a dual quad core xeon system, running freebsd 7.2 latest
> >>patch level, 64 bit, and 16 gb ram. using the latest nginx-devel.
> >>the OS runs on a ssd, the db is set on a normal drive, and the site
> >>files reside on another ssd.
> >>i had a pretty similar config just instead i was using centos.
> >>the i/o on the main drive (os drive) is constantly at 22 mb/s.
> >>i have disabled nginx logging, and everything has been setup from
> >>the ground. i have no idea why do i get such high i/o, because i
> >>have no other apps that could cause this load.
> >Do you use proxy for big replies and/or have big client uploads?
> >If yes, it's probably caused by disk buffering (you should have
> >warnings in logs, but you have no logs...) and you probably want
> >to tune your buffer sizes and/or proxy_temp_file_max_size.
> >Maxim Dounin
> >>could you please point me to some direction ? i don't know what to do.
> >> ad4 ad5 ad6
> >> KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s
> >> 54.56 428 22.79 0.00 0 0.00 32.89 4 0.14
> >> 55.05 492 26.46 0.00 0 0.00 26.38 8 0.21
> >> 55.24 452 24.40 0.00 0 0.00 36.36 5 0.20
> >> 53.20 457 23.76 22.31 19 0.42 19.88 8 0.16
> >> 53.33 464 24.15 0.00 0 0.00 48.47 23 1.11
> >> 54.14 403 21.32 0.00 0 0.00 16.18 217 3.43
> >> 52.75 406 20.90 0.00 0 0.00 17.49 178 3.04
> >> 55.75 402 21.90 0.00 0 0.00 13.42 12 0.16
More information about the nginx