alert: ... pread() read only

Francis Daly francis at
Tue Nov 19 09:19:19 UTC 2013

On Tue, Nov 19, 2013 at 09:39:44AM +0200, Nikolaos Milas wrote:

Hi there,

> 2013/11/17 12:39:14 [alert] 20709#0: *9059 pread() read only 38605 of 
> 39107 from "/path/to/web/root/HTML/gmap/gmapv3_auto_el.html"

> ...that this is probably related to the "open_file_cache" directive, and 
> in fact I do use (based on advice found on the Internet):
>    open_file_cache max=5000 inactive=30s;

> Is there anything I could/should do to optimize system operation to 
> avoid errors?

Don't change files that nginx has in open_file_cache.

> Should I disable open_file_cache or not? (I do not entirely understand 
> its implications.)

open_file_cache says "I am happy to occasionally return stale data or
errors, in exchange for the speed-up in normal use".

The errors will happen when a file size is changed in-place -- so "mv
a.html b.html && echo new > a.html" should continue to serve the old
content of a.html; but just "echo new > a.html" will show something odd
if the old length of a.html was not exactly 4.

> How should we determine the directive benefits?


Only you can do a test against your hardware. Get some clients (on remote
machines) and make the requests and examine the responses.

Note that you later say that you are using a virtual machine on a shared
system. That suggests that the actual hardware available to nginx will
vary over time, so any tests will not be valid for any other time.

You also describe how the file system is set up. I can't tell whether
that will necessarily break open_file_cache, even if the files themselves
are not changing underneath nginx.

If you know that the files are not changing but the pread() errors
persist, then disable open_file_cache to see if it stops the errors,
and then it my be worth investigating whether that filesystem set up is
as stable as nginx expects.

Francis Daly        francis at

More information about the nginx mailing list