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 ?