On Tue, 24 Mar 2015 23:35:58 +0100 Sigurd Mytting sigurd@mytting.no wrote:
I would connect to PostgreSQL and issue a "ALTER DATABASE nav SET log_min_duration_statement TO 1500;", then restart NAV.
Just did, the main thing looks like
2015-03-24 23:05:58 CET LOG: duration: 130238.622 ms statement: INSERT INTO "ipdevpoll_job_log" ("netboxid", "job_name", "end_time", "duration", "success", "interval") VALUES (1187, 'dns', '2015-03-24 23:03:48.719354', 1285.223631, true, 3600) RETURNING "ipdevpoll_job_log"."id"
Ugh, that's a nasty run time!
Any ideas appreciated!
I immediately have one:
Connect to the nav database and issue this statement:
DROP TRIGGER IF EXISTS trig_trim_old_ipdevpoll_job_log_entries_on_insert ON ipdevpoll_job_log;
This trigger will try to prune old entries from the ipdevpoll_job_log table on about 20% of INSERT statements to said table. That is perhaps too often (and I'm not really comfortable with having it as a trigger, as it belongs in some log rotation job that we don't yet have).
Removing the trigger will cause your ipdevpoll_job_log table to grow indefinitely, however. If this alleviates your problem, it's a strong indicator that we shall have to find another way to prune this table.