0

we are using redis 2.6.14 with 10GB RAM as cache server and phpredis as redis client. We both write and read from one same redis server.

The problem is, when the traffic goes high, we still can connect() this machine, but ping() it will return false, yes only false. The connected_client was below 100, used_memory below 1GB, qps about 1000, which all seem fine.

We have checked almost everything we know, except what does ping() do in phpredis/redis? And on what circumstances will ping() return an error? Apprently, our machine is still connectable when ping() error. https://github.com/nicolasff/phpredis#ping

Any idea?

I've solved this problem by swithing from connect() to pconnect();

蒋艾伦
  • 464
  • 1
  • 5
  • 16
  • Are you sure the particular connection is available for other commands? Does it reconnect automatically? – Gustav Nov 05 '13 at 13:45

1 Answers1

0

Firstly, ping do this - http://redis.io/commands/ping In your situation, i think the server is overloaded with HDD interaction operatoions.

What is your settings for save in /etc/redis.conf?

for me the default ones works ok. I think you need only this settings

save 180 1

this will make full database save every 3 minutes if at least 1 data element have changed

vodolaz095
  • 6,680
  • 4
  • 27
  • 42
  • We made rbd dump every 900s for at least one change. Will 1800s for a change be better? – 蒋艾伦 Nov 04 '13 at 08:21
  • "Redis server went away", I got this exception on ping(); – 蒋艾伦 Nov 04 '13 at 09:13
  • >Will 1800s for a change be better? It depends on the time required to make a full database dump >"Redis server went away", I got this exception on ping(); it mean that redis is hunged up. I think there is 2 posibilities. The less probable - errors in redis client implementation, the more possible - redis server is not probably configured and hangs up... or ping command is overloaded in config... – vodolaz095 Nov 05 '13 at 07:22
  • thanks, I've solved this problem by swithing from connect() to pconnect() – 蒋艾伦 Nov 06 '13 at 14:11