Tips / Nginx

Nginx pread() read only of from errors


Today one of my customers was having a very strange issue with some static files. He was uploading static files (gif, jpg, css, etc) to his website that runs on Nginx webserver. And the problem was that from time to time, the changes he did were not reflected while browing the files online. Investigating the Nginx logs I found this error:

pread() read only xxxx of xxxx from “/var/www/” while sending response to client

This were the complete logs:

2014/06/26 12:44:47 [alert] 9743#0: *192873 pread() read only 12133 of 12135 from "/var/www/" while sending response to client, client: 190.247.xx.xx, server:, request: "GET /people/jessie.html HTTP/1.1", host: "", referrer: ""

2014/06/26 12:46:27 [alert] 9743#0: *196302 pread() read only 12537 of 12540 from "/var/www/" while sending response to client, client: 85.59.xx.xx, server:, request: "GET /people/myluv.html HTTP/1.1", host: "", referrer: ""

Investigating my Nginx configuration I found this may be related to the files cached using open_file_cache option on Nginx. According to Igor Sysoev (creator of Nginx) on this forum it was caused because the file was not updated atomically.

Temporary disabling open_file_cache fixed the issue.


Popular search terms:

  • 929K
  • debian nginx error 13 upstream post -apache -php
  • https://www scalescale com/tips/nginx/nginx-pread-read-only-of-from-errors/
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1828 cClL0IbAGcycR91453wHISws9-z2bw0v8NNcnJzgQ_Wv-PSX84QpjlfeLyWIXidw 2a73a85ca8497f324a8671fe8ac8d36765eeaf62&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme

Esteban Borges

Linux Geek, Webperf Addict, Nginx Fan. CTO @Infranetworking