# Can't set client timeout (AER-4344)

**URL:** <https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061>\
**Category:** PHP Client Library\
**Created:** [March 15, 2015, 8:16pm UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061 "2015-03-15T20:16:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manjeet\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Manjeet\_Kumar](https://discuss.aerospike.com/u/Manjeet_Kumar)\
**Post date:** [March 15, 2015, 8:16pm UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/1 "2015-03-15T20:16:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [March 15, 2015, 10:32pm UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/2 "2015-03-15T22:32:59Z")

</div>

Hi Manjeet,

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

Thanks.

---

<div class="post-metadata">

**Author:** ![Manjeet\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Manjeet\_Kumar](https://discuss.aerospike.com/u/Manjeet_Kumar)\
**Post date:** [March 16, 2015, 4:25am UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/3 "2015-03-16T04:25:33Z")

</div>

$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;
        }
        $db->close();
        return $response;
    }

    $db->close();
    return array("status"=>0);

```

and php.ini snippet already shown.

---

<div class="post-metadata">

**Author:** ![Manjeet\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Manjeet\_Kumar](https://discuss.aerospike.com/u/Manjeet_Kumar)\
**Post date:** [March 16, 2015, 4:54am UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/4 "2015-03-16T04:54:06Z")

</div>

extension=aerospike.so 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

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [April 6, 2015, 4:01am UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/5 "2015-04-06T04:01:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Crags](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/crags/32/309_2.png) [@Crags](https://discuss.aerospike.com/u/Crags)\
**Post date:** [August 10, 2015, 1:55pm UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/6 "2015-08-10T13:55:16Z")

</div>

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`  
`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:

`extension=aerospike.so`  
`aerospike.udf.lua_system_path=/usr/local/aerospike/client-php/sys-lua`  
`aerospike.udf.lua_user_path=/usr/local/aerospike/client-php/usr-lua`   
`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

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [August 10, 2015, 10:01pm UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/7 "2015-08-10T22:01:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Crags](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/crags/32/309_2.png) [@Crags](https://discuss.aerospike.com/u/Crags)\
**Post date:** [August 11, 2015, 7:34am UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/8 "2015-08-11T07:34:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [August 12, 2015, 1:12pm UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/9 "2015-08-12T13:12:01Z")

</div>

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](https://github.com/aerospike/aerospike-client-php/issues).

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

---

<div class="post-metadata">

**Author:** ![Crags](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/crags/32/309_2.png) [@Crags](https://discuss.aerospike.com/u/Crags)\
**Post date:** [August 12, 2015, 2:08pm UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/10 "2015-08-12T14:08:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [September 3, 2015, 10:21pm UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/11 "2015-09-03T22:21:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [October 22, 2015, 11:24pm UTC](https://discuss.aerospike.com/t/cant-set-client-timeout-aer-4344/1061/12 "2015-10-22T23:24:45Z")

</div>

This issue, AKA CLIENT-88, is fixed in [release 3.4.3](https://github.com/aerospike/aerospike-client-php/releases/tag/3.4.3).
