Static file benchmarks

Cocoa Guy cocoa.guy at
Mon Apr 21 23:08:49 MSD 2008

On Fri, Apr 18, 2008 at 1:10 PM, Denis S. Filimonov <den.lists at> wrote:
>  > On Fri, Apr 18, 2008 at 11:38 AM, Denis S. Filimonov <den.lists at> wrote:
>  > > Amazon EC2 works in a virtualized environment with a network filesystem.
>  > >  It's hard to expect top performance in such setting.
>  > >  It's also hard to tell which factors limit the throughput because you
>  > > don't get to see the full picture.
>  >
>  > Right, this is a virtualized environment, but the disk performance on
>  > an EC2 instance is at least 40 MB/sec. Is it possible at that speed
>  > for the disk to be the limiting factor? I've read that files read from
>  > disk are cached in the kernel cache, but I have no clue...
>  >
>  The problem is probably the latency rather than raw disk read throughput.
>  For example, in NFS, every time a process opens a file, a request is sent to
>  the NFS server to check if the file has changed, even though the file itself
>  can be locally cached. This is done to implement so called close-to-open
>  consistency.
>  If this is the case (I'm not even sure what filesystem they use) then using
>  NGINX's file descriptor cache *might* help. Sadly, it is described in the
>  wiki, yet. Try adding the following snippet:
>  ----
>  open_file_cache          max=1000  inactive=20s;
>  open_file_cache_valid    30s;
>  open_file_cache_min_uses 2;
>  open_file_cache_errors   on;
>  ----

I upgraded to nginx 0.6.29 (it doesn't look like open_file_cache is
supported in 0.5.x) and added these settings, but it made no
difference in the benchmark results.

On Fri, Apr 18, 2008 at 2:17 PM, kingler <kingler at> wrote:
> It might also help troubleshooting if you turn off the gzip compression option.
>  This will reduce the CPU overhead (in virtualized environment, there
>  might be some CPU overhead, which is not there in a dedicated server
>  environment)

I turned off the gzip option, but it made no difference. I would have
to indicate to Apache Bench the proper headers to enable gzipping

I appreciate everyone's willingness to help so far, but with so much
talk about nginx's performance, I would have thought there would be
more concrete information as to the reasons for nginx's performance.

Igor, any information you can share as to the limiting factors for
static file performance? Is nginx CPU bound? Disk bound? RAM bound?
Network bound? Even if you can point to older discussions about the
same topic. I haven't been able to find any information.


More information about the nginx mailing list