I've been having some problems with Table Storage today, including some intermittent but very long timeouts. While diagnosing this I wrote a test which executes a lot of concurrent reads against table storage. I set the TableServiceContext.Timeout property
to 1 (second) for this. Every now and then one of my queries times out, but the client waits basically forever for it. Also, my $MetricsTransactionsTable shows no server timeouts. So I'm confused about a few things:
- Why am I getting occasional timeouts?
- Why is the client waiting forever for a response, rather than timing out after 1 second?
- Why doesn't the $MetricsTransactionTable show any server timeouts?
Details
The test code is a bit complicated, because it uses some of my production code. But the basics are:
- Create a table and populate with 2000 entities. They're all in the same partition.
- Set TableServiceContext.Timeout = 1;
- Create a separate CloudTableQuery<> to retrieve each entity, using a point query (PartitionKey and RowKey)
- Execute all the queries using BeginExecuteSegmented()
- Wait until they're all completed.
Trace
When I run the above test using an HTTP connection and Fiddler, I can sometimes capture the failed request. It appears that the server just hangs forever and never actually returns. There's no HTTP response code, since the request never comes back. Here's
is a copy and paste of the Fiddler Statistics tab for the request. I can supply the full trace if needed.
Note that the Bytes Received is incorrect - Fiddler supplies a fake HTTP 504 response after the server times out. That is not actually a response from Table Storage.
Request Count: 1
Bytes Sent: 439 (headers:439; body:0)
Bytes Received: 638 (headers:126; body:512)
ACTUAL PERFORMANCE
--------------
ClientConnected: 16:37:09.974
ClientBeginRequest: 16:37:09.974
GotRequestHeaders: 16:37:09.974
ClientDoneRequest: 16:37:09.974
Determine Gateway: 0ms
DNS Lookup: 0ms
TCP/IP Connect: 34ms
HTTPS Handshake: 0ms
ServerConnected: 16:37:10.008
FiddlerBeginRequest: 16:37:10.008
ServerGotRequest: 16:37:10.008
ServerBeginResponse: 00:00:00.000
GotResponseHeaders: 00:00:00.000
ServerDoneResponse: 16:39:22.438
ClientBeginResponse: 16:39:22.452
ClientDoneResponse: 16:39:22.452
Overall Elapsed:
00:02:12.4785000