Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBlkU-0002hh-1q for pgsql-general@arkaria.postgresql.org; Mon, 15 Feb 2021 21:49:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lBlkS-00057I-Vq for pgsql-general@arkaria.postgresql.org; Mon, 15 Feb 2021 21:49:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBlkS-00057B-OA for pgsql-general@lists.postgresql.org; Mon, 15 Feb 2021 21:49:40 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lBlkQ-0001SN-HE for pgsql-general@lists.postgresql.org; Mon, 15 Feb 2021 21:49:39 +0000 Received: by mail-pf1-x432.google.com with SMTP id k13so4904535pfh.13 for ; Mon, 15 Feb 2021 13:49:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=EHAWc/y30b9Y0EzUz8qQPPmeInIgjqBC5vv+Gg16PjE=; b=IbJVtCIWNRbH2s5ISwnYZo1s5m+27pcowHpIkyRuyEUb3kq+GRsmi15V60FU9a1alh jA2CeeZPULzN8U0IPV+AIYQMsf76SnwliiLO20okIK21AcWp5LlwjPd2bkpu3N2Ij28q LgaLiRgxoTZie2SFFoNpmld7UtCHuqNfDofJqpodLKHumIVTAPlSV41717qRtotNX4+m ygYsio+ARE73TxIEBacfGFrxKIbRGJ721lurDGDKbxMUbzuJsld1OXJyF96Ab0+XBT0f H/Lmn+QgF7ViPXlpwx4w3/g5dP4Jhr04+5cRDGewP3jvbUERcjQfNUd6slWFAdSoPnb9 eE0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=EHAWc/y30b9Y0EzUz8qQPPmeInIgjqBC5vv+Gg16PjE=; b=e5sf2zGoOJQzrEYl8DM2cIJHx3eTNFAbxY1sEYUHSZAjN0X8epz6NI0TSqJUtH25Fb KNgKSSLtFPOBqpI1yatfTz9CfldM/+7yU3s7E6H1WblhA2h4Q6MtfMzHtOZrdAbdTvt1 2bd9u5H7JAxu/RWnBblYxHkq2D+DkvaLiVUXlW4Phy36AwxCSFR16G3MHmB5sXPhmHz+ X3gxdqROTiyUgA55j1Q4PdGROPA+8eCfRRNvgW7/mA50ruodyg2jHmhtY5om0Yrjo8MX uqYQuGvk8EfYrLh0u4IAv6GT7Z0INeoiPsCiMWu8T7H3lNtAHnFRi6AzYACLTPmjmrmA 3YqQ== X-Gm-Message-State: AOAM530zsoF1n3wsx24BetW4oTmT6zOwqx8W44/aKZqbGhCO5mgKiLNk N+yxdw2f4IurLlZ9RSx8YNUw97Guk9w= X-Google-Smtp-Source: ABdhPJzCbqa97k2q7lz4VRJhEy6f7vZyrHTrXrOPCk94eIBHCm51lfEMeqclGdEubEVpG/OgBkH4ZQ== X-Received: by 2002:a65:408c:: with SMTP id t12mr16360513pgp.157.1613425776916; Mon, 15 Feb 2021 13:49:36 -0800 (PST) Received: from tim-desktop (220-235-6-168.dyn.iinet.net.au. [220.235.6.168]) by smtp.gmail.com with ESMTPSA id k10sm20254869pfk.0.2021.02.15.13.49.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 13:49:36 -0800 (PST) References: User-agent: mu4e 1.5.8; emacs 27.1.91 From: Tim Cross To: pgsql-general@lists.postgresql.org Subject: Re: checkpointer and other server processes crashing Date: Tue, 16 Feb 2021 08:47:10 +1100 In-reply-to: Message-ID: <87wnv9ovbn.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Joe Abbate writes: > Hello, > > We've been experiencing PG server process crashes about every other week > on a mostly read only website (except for a single insert/update on page > access). Typical log entries look like > > LOG: checkpointer process (PID 11200) was terminated by signal 9: Killed > LOG: terminating any other active server processes > > Other than the checkpointer, the server process that was terminated was > either doing a "BEGIN READ WRITE", a "COMMIT" or executing a specific > SELECT. > > The database is always recovered within a second and everything else > appears to resume normally. We're not certain about what triggers this, > but in several instances the web logs show an external bot issuing > multiple HEAD requests on what is logically a single page. The web > server logs show "broken pipe" and EOF errors, and PG logs sometimes > shows a number of "incomplete startup packet" messages before the > termination message. > > This started roughly when the site was migrated to Go, whose web > "processes" run as "goroutines", scheduled by Go's runtime (previously > the site used Python and Gunicorn to serve the pages, which probably > isolated the PG processes from a barrage of nearly simultaneous requests). > > As I understand it, the PG server processes doing a SELECT are spawned > as children of the Go process, so presumably if a "goroutine" dies, the > associated PG process would die too, but I'm not sure I grasp why that > would cause a recovery/restart. I also don't understand where the > checkpointer process fits in the picture (and what would cause it to die). > A signal 9 typically means something is explicitly killing processes. I would check your system logs in case something is killing processes due to running out of some resource (like memory). If it is a fairly recent Debian system, journalctl might be useful for checking. -- Tim Cross