Can't set client timeout (AER-4344)


i m setting timeouts aerospike.connect_timeout 10000 aerospike.read_timeout 10000 aerospike.write_timeout 10000 in php.ini but when executing UDF from client it shows error Client timeout: timeout=1000 iterations=1 failedNodes=0 failedConns=0

please tell me how to set read timeout etc.


Hi Manjeet,

Can you show a snippet of the code that is exhibiting this?



$where = Aerospike::predicateBetween(“timeStamp”, $last30Days, $today); $results = array(); $response = array(); $agg_status = $db->aggregate(“namespace”, “set”, $where, “getTotalSummary”, “entry_function”, array($today,$yesterDay,$last7Days,$last30Days,“M”,1), $results ); echo $db->error(); if($agg_status == Aerospike::OK){

        foreach($results['bins'] as $key=>$value){
            $response[] = $value;
        return $response;

    return array("status"=>0);

and php.ini snippet already shown.

#4 aerospike.udf.lua_system_path=/opt/aerospike/client-php/sys-lua aerospike.udf.lua_user_path=/opt/aerospike/client-php/usr-lua aerospike.connect_timeout 6000000 aerospike.read_timeout 6000000 aerospike.write_timeout 6000000 this is my php.ini snippet for aerospike


We’re looking into the problem. The goal would be to roll out a solution with the next release (3.3.13).


Hi there. Can you confirm if this was fixed as I’m having the same issue. Below is my ext-aerospike.ini file which is loaded with PHP. If I run php -i | grep aero i get the following:

Additional .ini files parsed => /usr/local/etc/php/5.5/conf.d/ext-aerospike.ini,
aerospike support => enabled
aerospike version => 3.0
Registered save handlers => files user redis aerospike

So it shows that Aerospike is installed and running etc. My ext-aerospike.ini file contains the following:
aerospike.read_timeout 10000

But if I try to run a query, I get the following:

An error occured while querying [9] Client timeout: timeout=1000 iterations=1 failedNodes=0 failedConns=0

any ideas on what may be causing the issue, or any other way I can set the timeout on this? I’m pretty new to Aerospike so not sure where to look from here on.

Many thanks


Maybe it’s been copied over wrong, but there should be an equals sign in this config directive: aerospike.read_timeout=10000

Try again, if that was in fact a typo, please.


Ahhhh, perfect - thanks rbotzer - working fine now. One thing that is strange however is I also tried changing the timeout options by using Aerospike::OPT_READ_TIMEOUT => 12500 within my options array when connecting to the DB but this didn’t seem to have any effect. Again, is there something I’m doing wrong in terms of that?

Full connection code:

$opts = array(
Aerospike::OPT_CONNECT_TIMEOUT => 12500,
Aerospike::OPT_READ_TIMEOUT => 12500,
Aerospike::OPT_WRITE_TIMEOUT => 15000
$this->setDb(new Aerospike($this->getConfig(), true, $opts));

Many thanks


This seems to be a bug. There is a configuration ‘inheritance’ model, where

default values < config file values < constructor values < call value

So with a php.ini setting to 10000 and constructor value set to 12500, I expect the timeout to be 12500. If you passed a different value in the get() call, I expect that one to apply for the call. Please open a new issue in aerospike/aerospike-client-php.

By the way, 12.5s for timeout seems exceedingly huge. Is there a good reason for this?


Hey rbotzer - thanks for the feedback - I’ll submit an issue now detailing the bug.

I was only using 12.5s as a timeout for testing - just to ensure that the value was being passed form the relevant place etc, in reality it’s no where near that high but it helped me debug the issue.

Thanks again


Internally this is being tracked via JIRA ticket AER-4344.


This issue, AKA CLIENT-88, is fixed in release 3.4.3.