Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a website with load of about 60 000 requests per minute served by nginx. Recently, I have enabled the open file cache and saw a dramatic improvement in performance. But in the evenenings, when loads is maximum, response times are still quite large and nginx uses a lot of IO.

Here are my current settings:

open_file_cache max=10000 inactive=30s;
open_file_cache_valid    60s;
open_file_cache_min_uses 2;
open_file_cache_errors   on;

And I still have some memory left:

free -m
             total       used       free     shared    buffers     cached
Mem:          7910       6917        992          0        439        885
-/+ buffers/cache:       5592       2317
Swap:         8099          0       8099

Question: now do I choose correct value for open_file_cache max=10000 and other parameters? Is 10000 enough, is it too small or big? Is there a way to monitor open file cache use?

share|improve this question
up vote 2 down vote accepted

The open file cache is a caching system for metadata operations (file mtime, file existence etc), not for file content, so it helps but not as much as you would expect.

Some workarounds you could try are:

share|improve this answer

You could also try buffers as nginx won't write any temporary files when you have sufficient buffers

share|improve this answer
Perhaps you could show an example of how to do this in the configurations? – slm Jan 8 '14 at 1:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.