Performance issue on Redis with arrays
Both WMF and AUG have achieved a significant performance improvement with this patch which removes unnecessary calls to the underlying cache provider. However, in both cases we are using Redis
and Redis
itself is performing well.
I'm left with the conclusion that the issue is the way in which the php layer is handling arrays when using redis
.
On digging we are specifically calling serialize
and unserialize
in CRM_Utils_Cache_Redis
.
Discussion on the interweb thingee suggests that json_encode
& json_decode
may be faster but that is a moving target over php versions .... https://stackoverflow.com/questions/22718903/storing-an-array-of-data-using-redis-from-laravel
Another option appears to be the h
methods within the Redis php
class - I note in our PrevNextRedisCache
implementation we do use some of these hash specific methods and I wonder if using them here would help
https://stackoverflow.com/questions/22718903/storing-an-array-of-data-using-redis-from-laravel