How can I shring killbill database

108 views
Skip to first unread message

Marcin Marzec

unread,
Jul 3, 2018, 9:47:07 AM7/3/18
to Kill Bill users mailing-list
I do have 200k subscribers with monthly payments. My database size is now 56GB and grosing. Is there w way to purge old transactions or failed payments (which I do have a lot)?

Thanks
Marcin

Pierre-Alexandre Meyer

unread,
Jul 3, 2018, 12:05:30 PM7/3/18
to Marcin Marzec, Kill Bill users mailing-list
Hi Marcin,

200K accounts isn't that big of a number, are you sure all 56GB are taken by Kill Bill? Do you have specific tables that are growing more than others?

One safe option would be to clean the *_history and/or audit tables. Alternatively, if you have old accounts, you could clean the data by using our trimAccount procedure (https://github.com/killbill/killbill/blob/master/util/src/main/resources/trimAccount.sql).

Hope that helps,


--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/bb24c55f-8ee6-4d66-981d-7c35668f40f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Pierre

Pierre-Alexandre Meyer

unread,
Jul 5, 2018, 11:17:19 AM7/5/18
to Marcin Marzec, Kill Bill users mailing-list
[Adding mailing-list]

Yes, you should be able to cleanup the audit_log table. Some functionality won't be available anymore (especially in Kaui or the Analytics plugin), but I don't think it would impact the system.

Maybe rename the table first (and recreate an empty one) and verify it works as expected, before dropping it.

On Thu, Jul 5, 2018 at 6:05 AM, Marcin Marzec <marcin...@live.com> wrote:
Hi Pierre,

the biggest tables (mysql raw files) ar:

-rw-rw----  1 mysql mysql  16G Jul  5 14:43 audit_log.ibd
-rw-rw----  1 mysql mysql 8.1G Jul  5 14:43 bus_events_history.ibd
-rw-rw----  1 mysql mysql 3.9G Jul  5 14:43 bus_ext_events_history.ibd
-rw-rw----  1 mysql mysql 1.6G Jul  5 14:43 ccgw_responses.ibd
-rw-rw----  1 mysql mysql 1.6G Jul  5 14:43 invoice_items.ibd
-rw-rw----  1 mysql mysql 4.7G Jul  5 14:43 notifications_history.ibd
-rw-rw----  1 mysql mysql 4.5G Jul  5 14:43 payment_attempt_history.ibd
-rw-rw----  1 mysql mysql 3.9G Jul  5 14:43 payment_attempts.ibd
-rw-rw----  1 mysql mysql 3.0G Jul  5 14:43 payment_history.ibd
-rw-rw----  1 mysql mysql 3.1G Jul  5 14:43 payment_transaction_history.ibd
-rw-rw----  1 mysql mysql 2.6G Jul  5 14:43 payment_transactions.ibd

The largest are audit_log and bus_events_history tables. I can purge *_history tabled and ccgw_responses.
Can I do it for audit_log as well?

Thanks
Marcin



--
Pierre
Reply all
Reply to author
Forward
0 new messages