Redis backed view counters

Redis backed view counters 2.5.0

No permission to download
What will happen if we have more then 100k threads?
This add-on only updates actively viewed threads, not total number of threads. I'm fairly sure most XF forums don't have nearly that many active threads at any given time.

The code actually works based on total number of keys, so it just takes longer to visit all of them;
 
I noticed that I tried to install this on a site and it wants an older version than is available to install. Same for redis flood checker.

Code:
Could not process SV-RedisViewCounter-2.5.0 (1).zip: The following requirements for Redis backed Views Counters were not met: Redis backed Views Counters requires Redis Cache v2.17.0.

I have newer than that version....
 
Make sure the Redis Cache add-on is installed and active, it looks like it is missing the + sign to indicate newer versions
 
Make sure the Redis Cache add-on is installed and active, it looks like it is missing the + sign to indicate newer versions

It is installed and active and I'm using it.

Code:
[HEADING=2]Oops! We ran into some problems.[/HEADING]
Could not process SV-RedisViewCounter-2.5.0.zip: The following requirements for Redis backed Views Counters were not met: Redis backed Views Counters requires Redis Cache v2.17.0.

Code:
Redis Information
Version    7.2.14
phpredis version    6.1.0
Serializer    igbinary
Free memory    Unlimited
Used memory    2.8 MB
Peak memory    4.1 MB
Maximum memory    0 bytes
Maximum memory policy    noeviction
To Redis (kbps)    28
From Redis (kbps)    1,946
Operations per second    31
DB 0 Keys    898
DB 0 Average TTL    4,526,676
Connected clients    2

I have different namespaces in the config.php -- since I have more than one site sharing the redis server, could it be related to that?Screenshot 2026-05-14 at 1.28.28 PM.webp
 
Make sure you've updated src/config.php to set the Cache provider;
PHP:
$config['cache']['provider'] = 'SV\RedisCache\Redis';

Also try rebuilding SV/StandardLib add-on.
 
Last edited:
Am I right in thinking this should update the database (thread table) every 15 minutes when the cron runs?

I'm using Garnet (the Windows Redis compatible server) - which does support LUA, but nothing seems to happen and the cache just fills up with loads of thread counter keys, never being removed nor updating the database table.

Is there something else I need to change, or just not compatible?
 
Yes, it should push thread view changes every 15 minutes or so.

Try running the update view count crons repeatedly and see if the view counts go down. It is possible there are bots hammering away so it is continuously seeing lots of small number of views in e every thread
 
I was focused on one entry to see if it ever disappeared, but perhaps that was lower down in the queue...


Ok I'll try again later and keep hammering the cron.

But if it is due to a bot hammering, there's no solution (as in it will never catch up?)

How many records at a time does it process?
 
How many records at a time does it process?
It triggers a background job which processes upto 4000 threads at a time. It uses the redis scan command so it will visit every key without missing.

I guess it needs to be more aggressive, but provided the job.php is called frequently enough it'll catch up fairly quickly.
 
It triggers a background job which processes upto 4000 threads at a time. It uses the redis scan command so it will visit every key without missing.

I guess it needs to be more aggressive, but provided the job.php is called frequently enough it'll catch up fairly quickly.
It might just be a garnet thing, I'll try again and report back :)

Thanks.
 
Back
Top Bottom