pread() read only xxxx of yyyy

Solution 1:

I found this russian forum thread that says it's related to open_file_cache directives.

Makes sense, as I am using Sublime Text and it doesn't do atomic file saves.

Solution 2:

I have been the same issue, after many searches, its resolved by open_log_file_cache

open_log_file_cache      max=20000 inactive=30s min_uses=2;

It's not related to your question but for other visitors who searching for best practice of nginx file caching, this is my full file cache config after many searches and take many benchmarks.

# cache information about FDs, frequently accessed files
aio                      threads; # linux kernel > 2.6.22
open_file_cache          max=10000 inactive=120s; # removed from the cache if it has not been accessed during `inactive` time
open_file_cache_valid    120s; # Sets a time after which open_file_cache elements should be validated.
open_file_cache_min_uses 2; # Sets the minimum number of file accesses during the period configured by the inactive parameter
open_file_cache_errors   off; # Enables or disables caching of file lookup errors by open_file_cache.
open_log_file_cache      max=20000 inactive=30s min_uses=2;