DWQA QuestionsCategory: DatabaseRedis query is slower than MySQL
binphp asked 2 weeks ago
Deposit

Single data query
About 300000 data. It’s twice as slow to test as mysql. I don’t know where it’s wrong

3 Answers
Best Answer
cevin answered 2 weeks ago

The network IO problem may be. Check the network. Local

cevin replied 2 weeks ago

Okay. Check the local network. Hardware resource occupation and so on. What about sockets?

binphp replied 2 weeks ago

I made a naive mistake. I made 300000 links to redis and made modifications. I can use hgetall 10 times faster and get 15 times faster, but I still feel it’s not ideal. It’s still too slow

Blue skin mouse answered 2 weeks ago

If the network overhead is too large each time, you can consider to try redis’s pipelining feature. But note that the server will queue all requests in memory, so do not send too many requests at a time. For details, please refer to this
http://redis.io/topics/pipelining

hyper0x answered 2 weeks ago

Is the persistence of redis set? Redis is memory based. MySQL has no comparability with it.