redis-cache:metrics key growing up infinitely #46
-
DescriptionThe issue happens only on one of dozens of sites I have redis installed on. It started happening over a year ago. The site has basic redis configuration Expected BehaviorMetrics consume max 5-10 megabytes of memory Actual BehaviorMetrics key consume 500 megabytes (see attached screen) Possible FixDisabling metrics for that particular site (dummy fix) Steps to ReproduceI can't provide any steps for reproducing that bug Additional contextIt just consumes a lot of memory which instead should be available for the "real data" keys The site is running on two domains (completely separated, shared codebase but separate infra) and the issue exists on both. EnvironmentAs the bug occurs since over a year therefore it was happening under a range of versions up until the most recent Site is converted to a multisite since 2 months but the issue was happening for over a year when it was still a single site. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Please post your diagnostics. |
Beta Was this translation helpful? Give feedback.
-
Here you are
|
Beta Was this translation helpful? Give feedback.
-
The config looks good. You have 982,398 metrics recorded. If it's taking up too much space, use the |
Beta Was this translation helpful? Give feedback.
-
Thank you @tillkruss Well the current situation is when the DB was pruned few days ago so that doesn't reflect the state when its actually having 500mbs. Do you know why the number of metrics can grow so high? What are the rules for pruning/truncating the logs? What I observed is that the issue happens mostly in the times when the admin traffic is low (like current Christmas time). The environment is dockerized and the sites work in headless mode so admin per se is not hit. Do you prune/truncate metrics on certain admin actions or cron events? (To answer the not asked question - I have server side cron running). Maybe I will just dig it up in the source code and see what could be causing the overflow in my scenario. |
Beta Was this translation helpful? Give feedback.
-
One HTTP request will case one metrics entry. There is a So if you WP Cron isn't working properly it may build up over time. |
Beta Was this translation helpful? Give feedback.
One HTTP request will case one metrics entry.
There is a
rediscache_discard_metrics
scheduled event that will delete all metrics older thanWP_REDIS_METRICS_MAX_TIME
(1 hour by default).So if you WP Cron isn't working properly it may build up over time.