Many errors 9 (AS_ERR_TIMEOUT)

Hello, everyone! There is a problem. The code doesn’t work, and it returns error number 9 (error timeout). The function looks like this:

for ($attempts = 0; $attempts < 10; $attempts++) {
$atimeout = 20000;
$ttl = 0;
$retries = 5;
$sleep_retries = 500;
$key = $_db->initKey(AeroDBF::ADB, $set, $primaryKey);
$options = [
                \Aerospike::OPT_WRITE_TIMEOUT           => $atimeout,
                \Aerospike::OPT_MAX_RETRIES             => $retries,
                \Aerospike::OPT_SLEEP_BETWEEN_RETRIES   => $sleep_retries
            ];
$status = $_db->put($key, $putdata, $ttl, $options);
}

All attempts return an error number 9. Please tell me what to do

What kind of troubleshooting have you done so far?

We wrote a function with a large number of attempts and an increased timeout.

What exact message are you getting along with this error code… Error code 9 (timeout) is a bit special as it could be a client side timeout (client didn’t get anything back within the allocated time) or a server side timeout received on the client (where the server may have timed out, especially on a write where the replication needs to happen if replication-factor is set to 2 or more). On the client side, there are different tiemouts (socketTimeout and totalTimeout) and depending on the version being used, one or the other of those will be sent to the server. Not sure from the top of my head how those are exposed on the PHP client side, though.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.