I can see two potential causes:
1. If you have a 1k threadpool on each of 3-4 machines, you are
potentially creating and using 3-4k connections to Redis. If Redis is
configured with a maximum connection limit under 3-4k, you may get
exceptions like this.
2. If Jedis isn't re-using connections, but is instead creating and
destroying connections as they are needed, you can run out of outgoing
ports for connections, as most OSes recycle ports in a fairly lazy
manner (1 minute or more to reuse a port isn't uncommon).
Check your configuration. If your configuration is fine, check to make
sure Jedis is re-using connections. If that is fine, then it's
possible that you are moving enough data into Redis that you have run
out of threads. You could then catch the exception, wait, and retry.
Regards,
- Josiah
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
As per a recently mentioned bug:
https://github.com/antirez/redis/issues/162 , older versions of Redis
on certain platforms were limited by default system ulimit (1024
handles limit). You can force it to be larger, which is discussed in
that bug.
Regards,
- Josiah
On 11/11/11, Sonali Palkar <sona...@gmail.com> wrote:
> Hi All:
>
> I am using redis 2.2.12 server and using jedis 2.0 as a redis client. I
> have a single redis server instance on which I perform insert/update and
> read operations. I have 3 - 4 java applications which are inserting and
> updating around 23M keys in redis in a day. The data is not coming at a
> fixed interval of time with fixed size. Some times there could be a large
> push. My apps use jedis pool to get redis connection and insert data into
> redis. I have configured jedis pool to use around 1000 threads.
>
> My application throws this exception at times when there is a large push. I
> do not see this exception the entire day. It happens only when there is
> large data getting inserted.
>
> *"jedis.clients.jedis.exceptions.JedisConnectionException: Could not get a
> resource from the pool"*.
>
> Any idea why this exception comes at times and not the entire day even
> though I am using fixed number of threads via a thread pool to control the
> number of threads and hence the number of connections to redis?
>
> Best regards.
> Sonali
>
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.
>
>
--
Sent from my mobile device
Thanks!
Jonathan
Regards,
- Josiah
- Josiah
Regards,
- Josiah