Resource temporarily unavailable - Timeout reading from the socket

2,474 views
Skip to first unread message

Amod

unread,
Apr 7, 2012, 6:38:07 AM4/7/12
to Redis DB
I have redis 2.2 running on EC2 small instance.

I have a ruby code that sets data to redis. In the redis log I see the
below exception which is periodic depending on the load on the site
varying from 30 minutes to 5 minutes

Resource temporarily unavailable - Timeout reading from the socket

I do not see any error or warning message in my redis log.

Redis is vm-enabled
from info
vm_conf_max_memory:512000000
used_memory_human:469.77M

Please suggest pointers to figure out the issue. Let me know in case
more information is required.

Is there is a tool to monitor load on redis, like number of parallel
clients and memory utilized info and monitor are not good enough.

Thanks
Amod

Arun Vijayan

unread,
Apr 7, 2012, 7:11:56 AM4/7/12
to redi...@googlegroups.com
First, why are you using VM? I guess you have enough RAM to hold the data. 

Anyways, this  may be due to a number of reasons. It may simply due to a complex query that takes too long to run & stalls the server. For example a KEYS command can be lethal on production. I guess Redis 2.2 doesn't have slowlog command even if you want to check. 

It may be because you are (may be too frequently) spawning instances for background save. 

Also, check FAQ (mainly the overcommit memory section)

For further general info, try the latency page

-Arun Vijayan


Amod

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


Didier Spezia

unread,
Apr 7, 2012, 10:21:27 AM4/7/12
to redi...@googlegroups.com
EC2 small + old redis version + VM ?
You are looking for latency troubles ...

I'm not familiar with the Ruby client, but I remember there was a bug at a point
regarding the read timeout management in redis-rb or hiredis-rb:

https://github.com/pietern/hiredis-rb/commit/eb5062c2070ccdacc150d20f634b2ff9ce77708e

Basically, you get EAGAIN (Resource temporarily unavailable - Timeout reading from the socket)
when a read timeout has been set a the socket level, and Redis is not responsive enough for this
timeout. Try to increase the timeout (default value is 5 secs).

You did not mention if RDB and/or AOF are active or not, if your files are stored on EC2 EBS or not,
if you have already check you do not use any blocking commands (such as KEYS), if master/slave
replication is active, etc ... but really you should not expect miracles from this configuration in term
of latency.

I don't really understand why you cannot use INFO to monitor used memory and number of clients.
Both information are part of the result of the command.
Anyway, you may also want to read this:


Regards,
Didier.
Reply all
Reply to author
Forward
0 new messages