You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Avi Levi <av...@indeni.com> on 2017/08/23 18:40:27 UTC

configure pooling options to avoid BusyPoolException

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)))

Re: configure pooling options to avoid BusyPoolException

Posted by Akhil Mehra <ak...@gmail.com>.
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 <av...@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)))


Re: configure pooling options to avoid BusyPoolException

Posted by Avi Levi <av...@indeni.com>.
Thanks

On Thu, Aug 24, 2017 at 6:23 PM, Michael Burman <mi...@redhat.com> wrote:

> Hi,
>
> You could try something like (I tried to cleanup the code from other stuff
> in the gist-editor, so it might not compile directly) the following for
> your scheduling:
>
> https://gist.github.com/burmanm/230c306f88c69c62dfe737994444fc01
>
> That should prevent pool getting full, instead using the old blocking
> behavior for your code. Add your own twist of backpressure handling to the
> code obviously.
>
>   - Micke
>
>
>
> On 08/23/2017 09:40 PM, Avi Levi 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.excep
>> tions.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)))|
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: user-help@cassandra.apache.org
>
>

Re: configure pooling options to avoid BusyPoolException

Posted by Michael Burman <mi...@redhat.com>.
Hi,

You could try something like (I tried to cleanup the code from other 
stuff in the gist-editor, so it might not compile directly) the 
following for your scheduling:

https://gist.github.com/burmanm/230c306f88c69c62dfe737994444fc01

That should prevent pool getting full, instead using the old blocking 
behavior for your code. Add your own twist of backpressure handling to 
the code obviously.

   - Micke


On 08/23/2017 09:40 PM, Avi Levi 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)))|


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org