reduce size of sentry database

1,277 views
Skip to first unread message

Ameya Savale

unread,
Apr 13, 2015, 1:55:08 PM4/13/15
to gets...@googlegroups.com
 Hi,

what is the proper way to reduce the size of the sentry database. I'm using a postgres database, and that database has now grown to a really large size, what can I do to reduce the space taken up by the database?

- thanks
Ameya

David Cramer

unread,
Apr 13, 2015, 1:56:34 PM4/13/15
to gets...@googlegroups.com
The best thing to do is cron the ‘sentry cleanup’ task (sentry cleanup —help for options).

Because SQL doesn’t reclaim space, you might also need to periodically do standard maintenance on the database.

We personally use pg-reorg to shift things around without taking downtime, but you could also schedule downtime and do a full vacuum on tables to reclaim some space.
--
You received this message because you are subscribed to the Google Groups "sentry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getsentry+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ameya Savale

unread,
Apr 13, 2015, 2:07:00 PM4/13/15
to gets...@googlegroups.com
I'll try that, thanks


--
You received this message because you are subscribed to a topic in the Google Groups "sentry" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/getsentry/S4r8QM_669Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to getsentry+...@googlegroups.com.

Ameya Savale

unread,
Apr 13, 2015, 2:31:24 PM4/13/15
to gets...@googlegroups.com
is it safe to terminate sentry cleanup mid process, or will that leave sentry in a funny state?

On Mon, Apr 13, 2015 at 10:56 AM, David Cramer <dcr...@gmail.com> wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "sentry" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/getsentry/S4r8QM_669Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to getsentry+...@googlegroups.com.

David Cramer

unread,
Apr 13, 2015, 2:32:54 PM4/13/15
to gets...@googlegroups.com
Yep it’s safe.

It does it in batches so it can be slow but its always resumable.

Ameya Savale

unread,
Apr 13, 2015, 2:34:22 PM4/13/15
to gets...@googlegroups.com
great thanks david

Ameya Savale

unread,
Apr 14, 2015, 6:20:18 PM4/14/15
to gets...@googlegroups.com
Hey,

I've been running the sentry cleanup command since yesterday, ran it in screen. It is still running but it has been outputting only this line "Removing Event chunk 0" for a while now. Is there something wrong or does the task generally take a really long time to run?

- Thanks
Ameya Savale

David Cramer

unread,
Apr 14, 2015, 6:23:49 PM4/14/15
to gets...@googlegroups.com
It can take a really really long time. I assume its not constantly “0” right?

I just pushed a commit to master which adds —concurrency:

[master 14b4829] Add concurrency option to cleanup

Ameya Savale

unread,
Apr 14, 2015, 6:31:29 PM4/14/15
to gets...@googlegroups.com
Yeah it has been constantly zero, I've been seeing that exact same line, no change.

- Ameya Savale

David Cramer

unread,
Apr 14, 2015, 6:33:07 PM4/14/15
to gets...@googlegroups.com
Looks like thats just a visual bug. Just pushed a fix for that as well.

Ameya Savale

unread,
Apr 14, 2015, 6:34:49 PM4/14/15
to gets...@googlegroups.com
Great thanks! :)

- Ameya Savale
Reply all
Reply to author
Forward
0 new messages