Hi Simon,

phoenix.query.timeoutMs is a client side phoenix property. You can set it in client side hbase-site.xml for a global setting or can programmatically set it on per jdbc statement via stmt.setQueryTimeout(int seconds). 

There are a couple other hbase level timeouts that are in play:

hbase.client.scanner.timeout.period default value of 60 seconds
Starting from just released phoenix 4.7, phoenix automatically renews scanner leases so that applications don't run into errors arising out of scanner lease expiration. So using a default value for this should be fine. To take advantage of this feature you would need to use an HBase version of that is as new as 0.98.17 for HBase-0.98, 1.0.3 for HBase-1.0 and 1.1.3 for HBase-1.1. 

hbase.rpc.timeout - default value of 60 seconds
 
By default, Phoenix connections on a JVM share a single HConnection to a cluster. If you want different HConnections with their own phoenix and hbase level settings, you can do that by supplying a different principal or user string as described here: https://phoenix.apache.org/#SQL_Support. This is a good option if your different applications are running on the same JVM and they have different performance characteristics. This is also a good option if you are using a pre-4.7 release and need to have different hbase.client.scanner.timeout.period values for your applications.

Hope this helps.
- Samarth
 



On Tue, Mar 8, 2016 at 5:12 PM, Simon Lee <simon@marketo.com> wrote:
Hi all,

What is the best way to set up different phoenix query timeout values for different client applications? Suppose there are 5 different Phoenix client applications. These applications have different timeout requirements due to the characteristics of the applications. For example, the timeout requirements are

Application A is 60,000 milliseconds
Application B is 1,200,000 milliseconds
Application C is 600,000 milliseconds
Application D and application E are 300,000 milliseconds

Currently, the phoenix.query.timeoutMs in hbase-site.xml on the region servers is set to 300,000 milliseconds

If phoenix.query.timeoutMs is set to 60,000 milliseconds on the client machine where application A is located, will the value on the client (60,000) override the value on the region server (300,000), so the application’s A query will time out after 60,000 milliseconds?

If phoenix.query.timeoutMs is set to 1,200,000 milliseconds on the client machine where application B is located, will the value on the client (1,200,000) override the value on the region server (300,000), so the application’s B query will not time out after 300,000 milliseconds?

The factory default value of phoenix.query.timeoutMs is 600,000. If timeout value is not set on the client machine where application C is located, and timeout value is set on the region servers, will the factory default value on the client (600,000) override the value on the region server (300,000)? If so, the timeout value on the region server will never take effect.

Thanks!