pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: James(王旭) <wangxu@gu360.com>
To: pgsql-performance <pgsql-performance@postgresql.org>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: How to prevent POSTGRES killing linux system from accepting too much inserts?
Date: Wed, 18 Dec 2019 17:53:26 +0800
Message-ID: <tencent_59F48E3719B4AB494460DF9D@qq.com> (raw)
In-Reply-To: <CAAkGvS_wZ=Rk2MDzB4QT8=uNL52e=cMiDhDgA6U8FuMVrtSgJQ@mail.gmail.com>
References: <CAAkGvS8ocfeVFOCsxoAY6suzMkrW+O9twRAQ2c4WrZNbQ=vSpg@mail.gmail.com>
	<5019.1576602260@sss.pgh.pa.us>
	<CAAkGvS_wZ=Rk2MDzB4QT8=uNL52e=cMiDhDgA6U8FuMVrtSgJQ@mail.gmail.com>

Hello,I encountered into this kernel message, and I cannot login into the Linux system anymore:

Dec 17 23:01:50 hq-pg kernel: sh (6563): drop_caches: 1Dec 17 23:02:30 hq-pg kernel: INFO: task sync:6573 blocked for more than 120 seconds.Dec 17 23:02:30 hq-pg kernel: "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.Dec 17 23:02:30 hq-pg kernel: sync&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; D ffff965ebabd1040&nbsp; &nbsp; &nbsp;0&nbsp; 6573&nbsp; &nbsp;6572 0x00000080Dec 17 23:02:30 hq-pg kernel: Call Trace:Dec 17 23:02:30 hq-pg kernel: [<ffffffffa48760a0&gt;] ? generic_write_sync+0x70/0x70
After some google I guess it's the problem that IO speed is low, while the insert requests are coming too much quickly.So PG put these into cache first then kernel called sync.I know I can queue the requests, so that POSTGRES will not accept these requests which will result in an increase in system cache.But is there any way I can tell POSTGRES, that you can only handle 20000 records per second, or 4M per second, please don't accept inserts more than that speed.For me, POSTGRES just waiting is much better than current behavior.
Any help will be much appreciated.

Thanks,James

view thread (4+ messages)  latest in thread

Message-ID: <tencent_59F48E3719B4AB494460DF9D@qq.com>
Permalink:  ../tencent_59F48E3719B4AB494460DF9D@qq.com/
Also on:    postgresql.org/message-id/tencent_59F48E3719B4AB494460DF9D@qq.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: wangxu@gu360.com, pgsql-general@postgresql.org
  Subject: Re: How to prevent POSTGRES killing linux system from accepting too much inserts?
  In-Reply-To: <tencent_59F48E3719B4AB494460DF9D@qq.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox