Cleanup doesn't work

# sentry cleanup --days 30
12:39:35 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
12:39:38 [INFO] sentry.plugins.github: apps-not-configured
Removing expired values for LostPasswordHash
Removing expired values for OrganizationMember
Removing expired values for ApiGrant
Removing expired values for ApiToken
Removing expired files associated with ExportedData
Removing old NodeStore values


5 hours later. the process is frozen

[root@tntp-sentry-201 ~]# ps auxfww | grep clean
root       453  0.0  0.0      0     0 ?        S<   May08   0:00  \_ [kvm-irqfd-clean]
root     18316  0.0  1.3 265280 104984 pts/1   S+   15:39   0:05  |   |       \_ /usr/local/bin/python /usr/local/bin/sentry cleanup --days 30
root     18327  0.0  0.3  62860 26888 pts/1    S+   15:39   0:00  |   |           \_ /usr/local/bin/python /usr/local/bin/sentry cleanup --days 30
root      2926  0.0  0.0 112704   968 pts/1    S+   20:00   0:00          \_ grep --color=auto clean
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]# ps -eo pid,pcpu,pmem,comm,status,wchan | grep 18316
18316  0.0  1.3 /usr/local/bin/      - poll_schedule_timeout
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]# ps -eo pid,pcpu,pmem,comm,status,wchan | grep 18327
18327  0.0  0.3 sentry               - pipe_wait
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]# cat /proc/18316/status | grep voluntary
voluntary_ctxt_switches:	890
nonvoluntary_ctxt_switches:	175
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]# cat /proc/18316/status | grep voluntary
voluntary_ctxt_switches:	891
nonvoluntary_ctxt_switches:	175
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]#
[root@tntp-sentry-201 ~]# cat /proc/18327/status | grep voluntary
voluntary_ctxt_switches:	1
nonvoluntary_ctxt_switches:	0
[root@tntp-sentry-201 ~]#

postgresql db size is 100GB

What is your question here exactly? Seems like it is taking a lot of time to remove the old NodeStore values? And that’s why this process is separated from the regular Celery workers?

Why didn’t “sentry cleanup --days 30” return a result in 5 hours?
Can you please tell me how to delete old data from storage?

As a result:

0 1 * * * root cd <path_to_compose> && { time docker-compose run --rm worker cleanup --days 30; } &> /var/log/cleanup.log
0 8 * * * root { time docker exec -i $(docker ps --format "table {{.Names}}"|grep postgres) vacuumdb -U postgres -d postgres -v -f --analyze; } &> /var/log/vacuumdb.log