Frequent intermittent timeouts

First off, I’m not quite sure if this is a problem with the server configuration or the PHP SDK itself. I suspect that it is some combination of the two, but haven’t the slightest clue.

Problem:
I have a remote CB server. When trying to perform any operation against that server (reads/writes/etc) through the PHP SDK I experience a timeout error with something like an 80% frequency. That is, ~80% of the requests fail, saying they have timed out. I see this behavior against each of the buckets on the server, it is not bucket specific.

CouchbaseException [ 23 ]: Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout

The request’s I’m performing are singular gets and sets just to test. Also, there are no other applications running against the server in question, so I don’t think it’s overloaded.

Other Info:
I don’t see this error when I use either a different server with the PHP SDK, or when I use a different SDK (I tested with node) against the problem server. It only seems to occur with the combination of the one particular server and the PHP SDK.

Since the error told me that the operation timed out, I’ve attempted increasing the operation timeout on the bucket. This, unfortunately was to no avail. I then proceeded to increase all “timeout” properties on the bucket that were available.

// Yeah, maybe I've gone a little overboard with this. :(
$bucket->operationTimeout =     120 * 1000;
$bucket->viewTimeout =          120 * 1000;
$bucket->durabilityTimeout =    120 * 1000;
$bucket->httpTimeout =          120 * 1000;
$bucket->configTimeout =        120 * 1000;
$bucket->configNodeTimeout =    120 * 1000;
$bucket->htconfigIdleTimeout =  120 * 1000;

Anyway, that didn’t work either, and I don’t know how to debug this further. Any help with this issue would be much appreciated.


c sdk version: 2.4.6
php sdk version: 2.0.4

Is there an actual delay before the timeout? or does it seem to “time out” very quickly afterwards. I would suggest you enable logging (via LCB_LOGLEVEL=5 or similar, in the environment) and see what the logs mention.

1 Like

Hey, thanks for the response. The timeout is very quick, the entire process taking less 300ms. When the log level is updated, does that show up in the CB server’s administration panel, or are the logs I want somewhere else?

The logs will be in the stderr of the php process. I do recall there were some issues with setting timeouts in PHP, and this may have been fixed since. @brett19 – can you help here?

1 Like

Hey jfelsinger,

Would you mind setting your timeouts to some ridiculously high number and trying again (try 120000000)?

Cheers, Brett

1 Like

So far, it seems that the ridiculous timeouts actually seem to fix it. Though I haven’t tested for an exceedingly long time.

The timeouts, do they represent millisecond or microsecond values? I don’t remember seeing it specified in the docs, so I assumed milliseconds (where I would have had a 2min timeout before), but if it’s microseconds that could very-well explain the behaviour I was seeing.

Timeouts are specified in microseconds as we pass these values directly to our C SDK which also uses microseconds. Hopefully this explains the behaviour you encountered, though I’m curious why you were encountering timeouts prior to setting any timeout values (which would have used the default values)!

Cheers, Brett

1 Like