Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTcxd-0000dm-Lg for pgsql-general@arkaria.postgresql.org; Tue, 26 Dec 2017 00:19:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTcxb-0003R9-TV for pgsql-general@arkaria.postgresql.org; Tue, 26 Dec 2017 00:19:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eTcxb-0003Qr-FP; Tue, 26 Dec 2017 00:19:11 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eTcxY-0005uc-6U; Tue, 26 Dec 2017 00:19:10 +0000 Received: by mail-pg0-x242.google.com with SMTP id q12so288965pgt.7; Mon, 25 Dec 2017 16:19:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RsCs1AE+hch7auuzO79kjYjaC7ZsvObyHIpdL87AI/k=; b=idqINB8Z+3AcMblLWxKmuTS7QkovNxvvpQLf2i9sA1td59hjWGc13FoMgsXsoKHpvL GLufe6wgglNZBgd/64FoJ1bMnvrD4g1qyhPJnDWbT4uMbeaeIH7dUj/vAr99FogMo/1f JEia3qP/LfTLYNPqRuDcwOU76e5g834279eHBCOO2TreUjBU8Wn+i8zl6t9kuU722/IC mW77PUanHauNpiRrmqufbVWTS1d4oUd1czbiyXFugW1EsquSllsh1zXSFNPyul3jLbUa 5IMaSNcsbE77yOT/hwc/tcBuMe1RdmuxMjAOj+UsdiKhRJevHQxEimr4N53L5CMwkcAT 8rPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RsCs1AE+hch7auuzO79kjYjaC7ZsvObyHIpdL87AI/k=; b=VKU4DcwpxWVsB9r1K8YddeOfSiZugPmUdASqHtziF6rEufOboLamkWzBsrwaDLwGra N7xi07/8aumlvl2nVusgsx9GCGyGDSLYEVG9xzXr/6Eki9phEcaiUg3+WNKaSgPbwVPZ YsmUXVXBvIiKux5ldrgfvxRQwPkbugJXRPs4bZ9j96dOdd/UMncWe5pt5ECLBGZQQmEp rRD4kHjXG3AoPuVs3vra2NnGCa1w07ZCFzu0s/2Yl/ggXrG8YiXvhIcV021y0gkXno7+ gAV4Fk8AcUqG4P3PL9v0OUTu5sRbDQF42EaJEMvVi6MbnunQHx3XH55uod7QWFRdKMmZ vyng== X-Gm-Message-State: AKGB3mLSe3nYfBk/J1jsHRWyGQEtywI8jzemzhvc1axKfsaeC8rKMgXi os0SodyLX8QSqL5tuDDJwiw= X-Google-Smtp-Source: ACJfBosRgSCIM97DQRkjYU/LYOxt8HyFXCiUiSafMKrvPTcBtwOBLK8i0X0s70H11VSumw7itOWZVA== X-Received: by 10.99.176.3 with SMTP id h3mr21397256pgf.207.1514247547004; Mon, 25 Dec 2017 16:19:07 -0800 (PST) Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp. [61.215.137.162]) by smtp.gmail.com with ESMTPSA id u68sm55552698pfu.17.2017.12.25.16.19.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Dec 2017 16:19:05 -0800 (PST) Date: Tue, 26 Dec 2017 09:19:01 +0900 From: Michael Paquier To: Melvin Davidson Cc: nikhil raj , "pgsql-general@postgresql.org >> PG-General Mailing List" , pgsql-sql@postgresql.org, pgsql-admin@postgresql.org Subject: Re: High CPU usage in postgres servers Message-ID: <20171226001901.GB8114@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dTy3Mrz/UPE2dbVg" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --dTy3Mrz/UPE2dbVg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 25, 2017 at 06:12:05PM -0500, Melvin Davidson wrote: > On Mon, Dec 25, 2017 at 1:28 PM, nikhil raj wrot= e: >> Hi guys , >> when check the task manager I see these many postgres.exe are running. H= ow >> to identify which pid is running for which process please any one can he= lp >> me out. >> or Why these many postgres.exe are running on the server >> >> [image: Inline image 1] >> >> Thanks , >> Nikhil >> >=20 > It appears your O/S is Windows, but you have not included which version of > PostgreSQL. > Since the structure of pg_stat_activity has changed between 9.4 and 9.5 > the best I can advise is to > SELECT * FROM pg_stat_activity; >=20 > Otherwise, I would give you a query tailored to your version of PostgreSQ= L. Looking at queries that take a long time and look at their plans can help in measuring the impact on CPU. For example, a sequential scan with a large OR= DER BY would be bad. Windows is also paked with perfmon (Performance Monitor) t= hat you could use. Combined with PostgreSQL logs with PID information, you could always extract some information. In the context of Windows which has no POSIX fork() implementation, note th= at the build runs under the context of EXEC_BACKEND, where each process is dir= ectly called via automaticly-built command lines. Still you are giving close to no information regarding your system, so gene= ral pieces of advices are the best you can get. -- Michael --dTy3Mrz/UPE2dbVg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlpBlXUACgkQnvQgOdby QH36hw/9FoERgOnu3prVuTdhJ4/blRSqrqtgiMAY4HLwkK6J/dxJqjhWsPqNBoJv lu0VbuHnvO9pwsplCqTqn3THJ+pjnpgmS0flsUVblGYg72j9r7UJQx1QAUYW6IEo NhbHX05n8pO6KZC0HbjIMbby/nKtuMAfCcE00FPgyX5lxIkh/7XqDbidxPRvqmOu gfylCwoEg21/7bDEh6IU5yW7JGDw7wu7GldIpZ76hPXaogxnoRrEc02SjQrV0ghB T2xcJGVEXJV6ICON6p6KFSXUk4AZzJysJ/vg6b9Fbwzt09TMdBu4+Qdopz4uGJ9p seIc5CB2YYYAX/dzm0tkOtL/52dcyAwb35nWFlzbaLQS5sTH0ai1Gtc8TuMbkyIf 0aEJkZsa6TxQH7uMbndH9zOLVY7hCNO6yo58XjnPV4ITRbqNggXvV/I5AB/Ykm8Q pa2muhhPLu97y/tjM0FeXzjDWO2X95MgU1FMplDy/pSQtIX+o+uSrKfCG4LWC1ey NGrlBQsGBaik5boCKfeEF2YtXBYcxpmwT79ccldfXgevfJiqvC9j2KP3GMlYDnq8 FsXElNfbtkcPW414xp8DR1NW/oEXPAe66No4nv1Vr1sDJY0XdMp4aGt/IcmNOHyf 4K0rVSRza3num/+cf+jurlUvHSBCrCNz2qMra53i7aj/aqEXfrc= =39X3 -----END PGP SIGNATURE----- --dTy3Mrz/UPE2dbVg--