Reduce http_logs in database

Infos:

  • Used Zammad version: 5.1.x (latest version from yesterday)
  • Used Zammad installation type: source
  • Operating system: Ubuntu 20.04.3
  • Browser + version: Microsoft Edge 100

Hey guys,

is there an option to reduce the table http_logs?
This table is in my installation 9,3 GB big. The complete database is 10 GB big. So how can I reduce this?

I’ve found this comment bus it doesn’t work for me, nothing happens if I run this command:

You could run HttpLog.cleanup(1.week) via the Zammad rails console as a cronjob as a workaround.

The problem I think is my big Active directory instance which document every change on every AD-object. Changes on our AD-objects are 24/7.
Maybe it is possible to disable the Active Directory logging?
The table is for me only trash and nobody need it.

Thanks in advance!

You can’t disable Zammads HttpLog.
It helps a lot if you link the github commands you’re talking about:

Would you care to tell “what does not work” on that regard?
The provided command by Thorsten is how the scheduler does clean up old entries and thus should work without any issues.

You could double check by using HttpLog.first.created_at which should not be older than 1 week.

I know this is old and you may have solved your issue but hoping that this might help someone else in the future.

I had the same issue and I can confirm that command from Github works fine:

We have a user base of over 20k and use ldap sync. And after each sync the http_logs table was increasing quite a bit.

Just make sure after you run that command, to perform a vacuum in psql (vacuum verbose http_logs)
if autovacuum is not enabled (should be by default).

Once the vacuum is done, you should get the space back. Hope this helps if there is someone else who is having smilar issues.

Also, you are right, it would be nice to be able to control how much of the ldap stuff is being logged.

1 Like