Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id E77C81179B43 for ; Wed, 6 Jun 2012 09:40:47 -0300 (ADT) Received: from mail-ee0-f46.google.com ([74.125.83.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ScFXa-0006Zf-QO for pgsql-performance@postgresql.org; Wed, 06 Jun 2012 12:40:47 +0000 Received: by eeit10 with SMTP id t10so2305368eei.19 for ; Wed, 06 Jun 2012 05:40:33 -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:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=/6gjFMMcBGJuJ6oXT5fF/OOWC1akvko3hBjmfzYEl3o=; b=Balqo+bDihqPlKMNlSepKES9+C3CDxRwcYreN0FAALUIUazEYID4QRy2HWQNsghsAN OCdml8Ay6WPr+XguhtKHhXX8NdywJUTU/ayJ0Li4ZN5TToewkX28Mi2el7HDvnhAG7vo T5Ugas5ybY1h3laGezWnGtAqtbo2tWG2eYDYGtZfUJwTJz0Y9owoPkNCXjDmb8qzJkLF qo6RihZMA3OPV6c5EtwEatZicgpZF7ofyHWk+riYOxwO3Admx1/b8IFsB4jBEm8N7Hki KDKZJFbQH79SmmM4/Za+3eamKaIhqgQTo0R+u3OljalsnnnqFYPFcV/OcOdv25V1RTGv cyWQ== Received: by 10.14.119.77 with SMTP id m53mr10634056eeh.26.1338986433059; Wed, 06 Jun 2012 05:40:33 -0700 (PDT) Received: from [192.168.0.160] ([85.93.217.248]) by mx.google.com with ESMTPS id c51sm6004907eei.12.2012.06.06.05.40.31 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jun 2012 05:40:32 -0700 (PDT) Message-ID: <4FCF4FBE.3030807@googlemail.com> Date: Wed, 06 Jun 2012 14:40:30 +0200 From: Patric Bechtel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: pg 9.1 brings host machine down References: <4FCF4C39.6000506@gmail.com> In-Reply-To: <4FCF4C39.6000506@gmail.com> X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201206/29 X-Sequence-Number: 47055 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, which fs with which settings are you using? What's the work_mem settings? Which size do the files have? Depending on the answer of above questions I would suggest: - - RAM disk, SSD or separate disk for pgsql_tmp - - using xfs with noatime,nodiratime,delaylog,logbufs=8,logbsize=256k,nobarrier for the tmp area - - separating pg_xlog on yet another disk (xfs, too, but with barrier) - - using deadline scheduler for all database disks - - increasing work_mem to at least the "common" file size +50% there's more if I'd know more about the setup. hth, Patric Vitalii Tymchyshyn schrieb am 06.06.2012 14:25: > 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 :( >> >> > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: GnuPT 2.5.2 iEYEARECAAYFAk/PT7sACgkQfGgGu8y7ypCr+QCglfi5t4mllLrqVBTbk8SIHt7i 2y8An2wzekmPmx7DsXDQ/h/t2lwDfYDs =BHRV -----END PGP SIGNATURE-----