Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id E9E6A1179B45 for ; Wed, 6 Jun 2012 09:26:20 -0300 (ADT) Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ScFIs-0008Pp-Cg for pgsql-performance@postgresql.org; Wed, 06 Jun 2012 12:26:19 +0000 Received: by lahd3 with SMTP id d3so4585472lah.19 for ; Wed, 06 Jun 2012 05:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=lZ3w3KSHDdPTMfeP1qYeSAcxcY9DKFqITHW5Ce4kB90=; b=lTSbkMs6voqzTIXWpt4VscsmwDyf0a3zqyWu85fJbt1dPVrx1XK/arOKX8wfO6jho/ pzbaeJSSIeSJDflSBJlmPVdSHZKMdNAcyatPs7qBsSuYMdzfYOxmSzwek+2Rm/laNChS 10eC2KXpGwQ9/reZMIwPdBkIJ9qEEvHmR38F8PpqjN0w6x7+DPNQ29+4KRnJLMCkMYAa wjSlQ+DMZENkC0J23PTbTad67ki0DBMTEEcCHkj4UoYEx6R2SvbhgAajesZHtnTGxjei XGtKQ6o65yzWcJ64b83Fo8BVmmvPiOh8ekzb8c0Mlq19BkNhRwOg6Rl4CzMFme6iHRd5 F6Iw== Received: by 10.152.146.163 with SMTP id td3mr21709229lab.26.1338985521553; Wed, 06 Jun 2012 05:25:21 -0700 (PDT) Received: from [10.64.1.26] ([94.45.140.16]) by mx.google.com with ESMTPS id d3sm1032233lbh.3.2012.06.06.05.25.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jun 2012 05:25:19 -0700 (PDT) Message-ID: <4FCF4C39.6000506@gmail.com> Date: Wed, 06 Jun 2012 15:25:29 +0300 From: Vitalii Tymchyshyn User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Konstantin Mikhailov CC: pgsql-performance@postgresql.org Subject: Re: pg 9.1 brings host machine down References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.5 (--) X-Archive-Number: 201206/28 X-Sequence-Number: 47054 Hello. Seen this already. It looks like cross join + sort. Badly configured ORM tools like Hibernate with multiple one-to-many relationships fetched with 'join' strategy may produce such result. Unfortunately I don't know if it's possible to protect from such a case at server side. Best regards, Vitalii Tymchyshyn 06.06.12 15:05, Konstantin Mikhailov написав(ла): > I'm faced with a problem running postgres 9.1.3 which seems to > nobody else see before. Tried to search and only one relevant > post fond (about millions of files in pgsql_tmp). > > Sympthoms: > > Some postgres process size is getting abnormally big compared > to other postgres processes. Top shows the 'normal' pg processed > is about VIRT 120m, RES ~30m and SHR ~30m. That one > is about 6500m, 3.4g, 30m corresp. Total RAM avail - 8g. > When one more such a process appears the host going into > deep swap and pg restart can help only (actually the stop > won't even stop such a process - after shutdown it still alive > and can be only killed). > > base/pgsql_tmp contains millions of files. In this situation stop > and dirty restart is possible - the normal startup is impossible > either. Read somewhere that it tries to delete (a millions > files) from that directory. I can't even imagine when it finish > the deletion so i'm simple move that folder outside the base > - then start can succeed. > > on ubuntu 11.10,12.04 x64. cpu intel core Q9650 3GHz. > 8G RAM. > > Does anybody see that behaviour or maybe have some glue how to > handle it. > > PS: the my preliminary conclusion: some sql is produces > a lot of files in the temporary table spaces - very quickly. > When sql is finished postgres tries to cleanup the folder > reading all contents of the folder and removing the files > one by one. It does the removal slow (watched the folder > by `find pgsql_tmp | wc -l') but process still consumes the > RAM. Next such sql will be a killer :( > >