Since queries are asynchronously executed, you will need some mechanism in your 
code to queue your request. Try setting your setMaxQueueSize to meet your need. 
By default its 256

 
http://docs.datastax.com/en/latest-java-driver-api/com/datastax/driver/core/PoolingOptions.html#setMaxQueueSize-int-

If setMaxQueueSize does not do the trick for you then you might need to look at 
throttling your queries.

Regards,
Akhil


> On 24/08/2017, at 6:40 AM, Avi Levi <a...@indeni.com> wrote:
> 
> Hi ,
> I need to execute large amount (millions) of select queries. but I am getting 
> BusyPoolExcption how can I avoid that ? I tried to configure the pooling 
> options but couldn't see that it had any impact 
> Any advice ?
> Failed to execute query SELECT * FROM my_table WHERE id = 'some_uuid' AND x 
> >= 1503501104 AND y < 1503501224;
> com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) 
> tried for query failed (tried: localhost/0:0:0:0:0:0:0:1:9042 
> (com.datastax.driver.core.exceptions.BusyPoolException: 
> [localhost/0:0:0:0:0:0:0:1] Pool is busy (no available connection and the 
> queue has reached its max size 256)))

Reply via email to