Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZHddW-0008KF-Q3 for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Jul 2015 19:55:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZHddW-0001KY-7W for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Jul 2015 19:55:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZHZ1b-00005J-Id for pgsql-bugs@postgresql.org; Tue, 21 Jul 2015 15:00:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZHZ1Y-0003ND-0N for pgsql-bugs@postgresql.org; Tue, 21 Jul 2015 15:00:06 +0000 MIME-Version: 1.0 Subject: BUG #13510: memory problem with mass-update statements To: pgsql-bugs@postgresql.org From: peter.slavov@sumup.com Date: Tue, 21 Jul 2015 14:59:36 +0000 Message-ID: <20150721145936.9707.48553@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.2 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 13510 Logged by: Peter Slavov Email address: peter.slavov@sumup.com PostgreSQL version: 9.4.4 Operating system: Debian wheezy Description: Hi, In our company we have a zabbix monitoring server which uses PostgreSQL database to store data. Most of the time the servers run very fast and stable. But after a zabbix server restart something strange happen - some cache flush to database is activated and on the database there multiple updates are executed. Updates are formed as a string with multiple queries in it - like this: ------------ update trends_uint set num=12,value_min=1,value_avg=1,value_max=1 where itemid=24134 and clock=1437400800; update trends_uint set num=6,value_min=7028177,value_avg=7029677,value_max=7031178 where itemid=28942 and clock=1437400800; update trends_uint set num=12,value_min=3,value_avg=3,value_max=3 where itemid=38537 and clock=1437400800; update trends_uint set num=12,value_min=1,value_avg=1,value_max=1 where itemid=38538 and clock=1437400800; update trends_uint set num=12,value_min=1,value_avg=1,value_max=1 where itemid=38539 and clock=1437400800; update trends_uint set num=6,value_min=1434709932,value_avg=1434709932,value_max=1434709932 where itemid=40349 and clock=1437400800; update trends_uint set num=12,value_min=2,value_avg=2,value_max=2 where itemid=44233 and update trends_uint set num=12,value_min=1,value_avg=1,value_max=1 where itemid=44234 and clock=1437400800; -- more -- ~ 50 queries max ---------- when this happen this process on the PostgreSQL server starts to eat the whole available memory (4GB RAM + 8GB swap), until it crashes with "out of memory" error , and then it starts again. When this happen zabbix server is not affected in any way. Here is some more info: - database size is ~ 50GB - updated tables when this happen are partitioned daily for an year - ~365 partitions - shared buffers are set to 900MB Can you tell me where can be the problem - is it the partitions or something else? thanks -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs