markersocial suggested adding a new setting to automatically hard-delete old notifications after a specified number of days, similar to the existing email log deletion feature, to reduce database bloat—especially since notifications lose value over time and can consume significant space. They noted that many social platforms limit notification retention to weeks or months and shared that their server is struggling with disk usage. pmusaraj responded by pointing to the existing hidden setting max_notifications_per_user, which defaults to keeping the last 10,000 notifications per user and purges older ones weekly; lowering this value (e.g., to 1,000) can help manage space more aggressively. markersocial thanked them and planned to test the setting. patrickemin asked how to locate the setting, and Moin provided links to guides on accessing hidden site settings in Discourse. The discussion highlights a practical workaround for notification storage issues without requiring new code, while still acknowledging the value of a time-based deletion feature for future consideration.
Having a setting similar to the ‘delete email logs after days’ but for notifications (hard delete) would be very useful - with the default being 0 (disabled/keep forever).
Although it is nice to have a full history of notifications, the value of them decreases significantly with time and they are somewhat ephemeral. But can eat up quite significant space in the DB proportional to everything else.
From my understanding it’s quite common for social media platforms to not store notifications indefinitely - often a weeks to months range.
My poor server is being thrashed and disk space is filling up rapidly.
Does the existing max_notifications_per_user site setting help here? It is a hidden setting but it does a similar job, it limits the total number of notifications on an instance.
That setting by default will keep the last 10,000 notifications per user, and automatically purge the rest in a background job that runs every week. You could lower it to a smaller number (1000 maybe?) and then it’ll clean up even more aggressively.