FastCgi vs. Varnish very unexpected results

I used the blitz service to stress test my server a bit in order to see what the performance was like. In my current configuration, I am using the nginx built in fastcgi cache and I have confirmed it is activated and running (I can see it in the header return hit).

I am using WordPress under Unbuntu 12.04x64 + Mariadb + APC + NGinx + FastCgi + W3 Total Cache plugin

The problem is using fastcgi I am receiving a HUGE % of timeout errors that I did not see when I was using varnish.

Example Rush:

This rush generated 4,699 successful hits in 1.0 min and we transferred 3.13 MB of data in and out of your app. The average hit rate of 75/second translates to about 6,502,686 hits/day.

The average response time was 164 ms.

You’ve got bigger problems, though: 17.49% of the users during this rush experienced timeouts or errors!

Now Using Varnish

This rush generated 5,961 successful hits in 1.0 min and we transferred 67.18 MB of data in and out of your app. The average hit rate of 95/second translates to about 8,221,668 hits/day.

The average response time was 236 ms.

You have no errors or timeouts

Now with everything I have read here at rtcamp, I am under the impression that fastcgi should perform AT LEAST as good as varnish if not much better, yet test after test that I have run is showing me the opposite.

I should mention that I was using 250 users at 1 second timeout, and all errors are ONLY TIMEOUT NOT ERRORS on the final reports.

Now as rtcamp is the expert I have to assume that something MUST BE WRONG with my cgicash setup. Even though it is running, there must be something configured wrong to see such horrible results.

Where do I begin to troubleshoot this problem?

First, you need to make sure that FastCGI-cache is working. Otherwise requests will reach php/mysql backend.

Then, check nginx error.log for errors. Mostly there will be errors related to sockets/file-descriptor limits. If this is the case, please refer

Otherwise just attach your error logs here and I will have a look.