Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpuMr-0007xf-0K for pgsql-performance@arkaria.postgresql.org; Tue, 23 Jul 2019 12:58:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hpuMp-0008Gr-L4 for pgsql-performance@arkaria.postgresql.org; Tue, 23 Jul 2019 12:58:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpuMp-0008DW-89 for pgsql-performance@lists.postgresql.org; Tue, 23 Jul 2019 12:58:07 +0000 Received: from aart.rice.edu ([168.7.56.48]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1hpuMm-00010U-G4 for pgsql-performance@lists.postgresql.org; Tue, 23 Jul 2019 12:58:05 +0000 Received: by aart.rice.edu (Postfix, from userid 18612) id BFBCB427F28F; Tue, 23 Jul 2019 07:58:03 -0500 (CDT) Date: Tue, 23 Jul 2019 07:58:03 -0500 From: Kenneth Marshall To: Kristian Ejvind Cc: "pgsql-performance@lists.postgresql.org" Subject: Re: zabbix on postgresql - very slow delete of events Message-ID: <20190723125803.GD21184@aart.rice.edu> References: <3EC00A37-57CF-4B43-A737-968A87B02641@contoso.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EC00A37-57CF-4B43-A737-968A87B02641@contoso.com> User-Agent: Mutt/1.5.21 (2010-09-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Jul 23, 2019 at 08:07:55AM +0000, Kristian Ejvind wrote: > Hi > > This will be a rather lengthy post, just to give the full (I hope) picture. We're using Zabbix for monitoring and I'm having problems > understanding why the deletion of rows in the events table is so slow. > > Zabbix: 4.2 (never mind the name of the db - it is 4.2) > new values per second: ~400 > hosts: ~600 > items: ~45000 > Hi Kristian, Time series databases like Zabbix work poorly with the Housekeeper service. We had many similar sorts of problems as our Zabbix usage grew. Once we partitioned the big tables, turned off the Housekeeper, and cleaned up by dropping partitions instead everything worked much, much, much better. When we started using partitioning, we used the old inheiritance style. Now you can use the native partitioning. Regards, Ken