Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a8vMp-0000tm-Kq for pgsql-admin@arkaria.postgresql.org; Tue, 15 Dec 2015 19:34:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a8vMp-0000qr-6B for pgsql-admin@arkaria.postgresql.org; Tue, 15 Dec 2015 19:34:35 +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) (envelope-from ) id 1a8vMo-0000qk-JI for pgsql-admin@postgresql.org; Tue, 15 Dec 2015 19:34:34 +0000 Received: from mx4.wp.pl ([212.77.101.12]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a8vMl-0008I4-1a for pgsql-admin@postgresql.org; Tue, 15 Dec 2015 19:34:33 +0000 Received: (wp-smtpd smtp.wp.pl 5542 invoked from network); 15 Dec 2015 20:34:28 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1450208068; bh=PTldQkQPCIReNWDXUe2Z4gEJ6iLXMQLyL0Xr5UvvrnM=; h=From:To:Subject; b=W8csJLtG2AjzSrtLfO13Inva3HHXc51RDfSLReSQ/h26dVOsAaAlB+mR4ysfU8pPU JdxSBhGKHpNjMMw/MuD5iygzL2yG4xePTn5J/Xd8YKO5Atf8qMWd2WPezAc4js4hKv NpLufgLenV0/oKHv0lqlYNoSuqRJKEvCLT8ELIwc= Received: from out.poczta.wp.pl ([212.77.101.240]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with SMTP for ; 15 Dec 2015 20:34:28 +0100 Date: Tue, 15 Dec 2015 20:34:28 +0100 From: =?ISO-8859-2?Q?Micha=B3_Nowak?= To: pgsql-admin@postgresql.org Subject: semop hanging - Postgres 9.4.4 Message-ID: <56706b44002bc1.54511812@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Mailer: Interfejs WWW nowej poczty Wirtualnej Polski X-User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12 Organization: Poznaj Poczte WP http://poczta.wp.pl/info-start.html X-WP-IP: 37.157.203.70 X-WP-MailID: 8a1f2f5b3337cfd3a91b97439fdf2565 X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [UbN0] X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Hello, Since couple of days on my Postgres cluster i've seen few times a hanged process. It looks like one of postgres workers stuck on simple INSERT query. PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 12173 postgres 20 0 1372M 345M run 166:18 24.47% 99.90% postgres: db01 db01 10.0.0.101(58713) INSERT It utilizes 100% of one CPU and after 1-2 hours it starts to utilize memory. After another 1-2 hours OOM-Killer have to take action. At the same time other postgres workers are properly processing queries. There's no error on syslog/dmesg. Strace: semop(58261738, {{12, -1, 0}}, 1) = 0 semop(58261738, {{12, -1, 0}}, 1) = 0 semop(58261738, {{12, -1, 0}}, 1) = 0 semop(58851580, {{0, 1, 0}}, 1) = 0 semop(58261738, {{12, -1, 0}}, 1) = 0 semop(58261738, {{12, -1, 0}}, 1) = 0 semop(58261738, {{12, -1, 0}}, 1) = 0 semop(57802972, {{1, 1, 0}}, 1) = 0 select(0, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout) semop(58261738, {{12, -1, 0}}, 1) = 0 semop(58261738, {{12, -1, 0}}, 1) = 0 semop(58261738, {{12, -1, 0}}, 1) = 0 Is this related to incorrect semaphores configuration? Here's my current configuration: sql01:~# ipcs -l ------ Shared Memory Limits -------- max number of segments = 4096 max seg size (kbytes) = 18014398509465599 max total shared memory (kbytes) = 18446744073642442748 min seg size (bytes) = 1 ------ Semaphore Limits -------- max number of arrays = 2048 max semaphores per array = 250 max semaphores system wide = 512000 max ops per semop call = 100 semaphore max value = 32767 ------ Messages Limits -------- max queues system wide = 32000 max size of message (bytes) = 8192 default max size of queue (bytes) = 16384 sql01:~# ipcs -u ------ Shared Memory Status -------- segments allocated 1 pages allocated 1 pages resident 1 pages swapped 0 Swap performance: 0 attempts 0 successes ------ Semaphore Status -------- used arrays = 257 allocated semaphores = 4369 ------ Messages Status -------- allocated queues = 0 used headers = 0 used space = 0 bytes Some values from postgresql.conf: max_connections = 4096 effective_cache_size = 12GB work_mem = 16MB shared_buffers = 1GB postgres=# select version(); version ------------------------------------------------------------------------------------------------------ PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit I would appreciate any help. Best Regards, Marcin -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin