Uncaught RedisException: socket error on read socket

(Saqib Ali) #1

Hi ,

We are using matomo 3.4.0 and trying using redis(aws ElastiCache redis) as cache as mentioned in this FAQ :

But getting this error :

PHP Fatal error: Uncaught RedisException: socket error on read socket in matomo\vendor\doctrine\cache\lib\Doctrine\Common\Cache\RedisCache.php:66
Stack trace:
#0 matomo\vendor\doctrine\cache\lib\Doctrine\Common\Cache\RedisCache.php(66): Redis->get(‘eagercache-340-…’)
#1 matomo\vendor\piwik\cache\src\Backend\Redis.php(18): Doctrine\Common\Cache\RedisCache->doFetch(‘eagercache-340-…’)
#2 matomo\vendor\piwik\cache\src\Backend\Chained.php(42): Piwik\Cache\Backend\Redis->doFetch(‘eagercache-340-…’)
#3 matomo\vendor\piwik\cache\src\Eager.php(49): Piwik\Cache\Backend\Chained->doFetch(‘eagercache-340-…’)
#4 matomo\config\global.php(46): Piwik\Cache\Eager->__construct(Object(Piwik\Cache\Backend\Chained), ‘eagercache-340-…’)
#5 [internal function]: DI\Definition\Source\DefinitionFile->{closure}(Object(DI\Container))
#6 matomo\vendor\php-di\invoker\src\Invoker.php(82): call_user_func_array(Object(Closure), Array)
#7 matomo\vendor\php-di\php-di\src\ in matomo\vendor\doctrine\cache\lib\Doctrine\Common\Cache\RedisCache.php on line 66

Does anyone have faced it ?


(Saqib Ali) #2

We used AWS , redis r4.large instance type and is memory optimized. After that this error did not appear .

(Saqib Ali) #3

Hi ,

Got the same error again though , does anyone have faced or know the reason ?

It looks matomo taking 10-15 sec to read “eagercache-340-tracker” cache and it may be causing this error .


(Saqib Ali) #4

Hi ,

Just to correct, time taken is in microsecond for “eagercache-340-tracker” so it does not seems to be the problem .


(Siva Kumar Rallabhandi) #5

This seems to be a problem with your Redis Server configuration. Checkout the performance tuning options that would help you avoid any problems with the Redis-


(Saqib Ali) #6

The problem looked to be the IIS queue length as queue got filled during peak time then IIS starts abandoning new requests and system got high CPU% letting redis requests in pending state .