0

I have a PHP app with 200 req/sec with a session table on MySQL with lastactivity, so I have to update it on every request. This keeps our MySQL server really busy so I decided to use REDIS to store these sessions.

After implementing REDIS on the project our response time increased from 500ms to 3-5s. Our REDIS server has 15k-20k keys no persistence and I'm using SET with expire time to store keys and GET for retrieve them.

For search an specific key I've used SCAN. I've tested different limits 100,500,1000 and 10,000 on SCAN.

Our keys schema : sessions:40:0:DZOJUxMWVnuIMcf4ef0307a832efc46771afde81292b174e91c94d08E23YK3YoMU

REDIS INFO :

redis_version: 6.0.6
connected_clients: 200 to 500
instantaneous_ops_per_sec: 4,000 to 10,000

Is there any thing that I can do to improve response time ?

Mojtaba Sayari
  • 475
  • 1
  • 5
  • 16
  • It seems your Redis server is good(5k-10k ops per sec, generally a good Redis server can serve for 100k ops/sec, depends on hardware). Can you check the network latency from your client to Redis server? – Gawain Apr 02 '21 at 08:45
  • well, since it's on Kubernetes infrastructure, we don't have any network latency here. – Mojtaba Sayari Apr 02 '21 at 20:43

0 Answers0