Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0A6G-0006uz-5o for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jun 2015 14:57:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z0A6F-00041t-Mx for pgsql-performance@arkaria.postgresql.org; Wed, 03 Jun 2015 14:56:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z0A6E-00041n-Vb for pgsql-performance@postgresql.org; Wed, 03 Jun 2015 14:56:59 +0000 Received: from mail-wg0-f52.google.com ([74.125.82.52]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z0A68-0007lQ-0C for pgsql-performance@postgresql.org; Wed, 03 Jun 2015 14:56:58 +0000 Received: by wgez8 with SMTP id z8so11590538wge.0 for ; Wed, 03 Jun 2015 07:56:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=3YY3rUird+DFjl8+nNCKI9cyuCKDHK9x0uj0Uov68Uc=; b=McDmvWU+WrP/Yeqo29ltMEPqiG3HXpC3dn5ZS6ZTtT50lxCYPbs7asj7x00QbaZesF /Z/vx+Q7Oc7RtFisqu/YmZeZLopeeh5g+AZpKLSJ5pe3k95sZxbSldvfcTkbU+LVe1R7 MUbjxE4hpjdxAd3pU174t5Z2eRjV/Orh5HkkEFDEa7FXHVtDvHuHJcChQ85QJh5jXeRy bM2Qd0bc8Qr58oZCJItetnjLDOIXWftu/Bj+7MzQRF1vp4r4Y8vFI8cr27HYbd13JHfY 5q/sKR4CNY9STEPwDmYbX5zU4UlnghBxwKQtUmXCzYQYuhZuvnhogT/SwdyiKqG49mBG gYUg== X-Gm-Message-State: ALoCoQll3rpJX/git4ybZU+P8vwR+xfHEL8dE1kUWuTWnUMI9/9XA7r0KPYPIZZcGAYRRX1VpRpRoqzZ3YoFb6Btgp29z0ldsEhfpYB2lcydWQHzTNunRkmEUOEzgv93XBQg1nmFoWTa4VudFrrr+NTjBjTp8f37VyuKVLKg+A8iJXsl1lmuxR5kK3Cj/0vt7oDErnh2vPbqFr7tNOOYZ3XJqbIX0kCtOQ== X-Received: by 10.194.193.71 with SMTP id hm7mr62944362wjc.40.1433343409843; Wed, 03 Jun 2015 07:56:49 -0700 (PDT) Received: from [10.137.2.12] (ip-89-176-99-192.net.upcbroadband.cz. [89.176.99.192]) by mx.google.com with ESMTPSA id o4sm5317386wib.5.2015.06.03.07.56.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 07:56:49 -0700 (PDT) Message-ID: <556F15AD.4040801@2ndquadrant.com> Date: Wed, 03 Jun 2015 16:56:45 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: How to reduce writing on disk ? (90 gb on pgsql_tmp) References: <1433334092106-5852321.post@n5.nabble.com> <1433337082772-5852328.post@n5.nabble.com> <556F0649.9000402@2ndquadrant.com> <9DED5F42-2C51-4CDE-A179-56A8A9370338@playrion.com> In-Reply-To: <9DED5F42-2C51-4CDE-A179-56A8A9370338@playrion.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 06/03/15 16:06, ben.play wrote: > The query is (unfortunately) generated by Doctrine 2 (Symfony 2). > We can’t change the query easily. Well, then you'll probably have to buy more RAM, apparently. > This is my config : > > max_connections = 80 > shared_buffers = 15GB > work_mem = 384MB > maintenance_work_mem = 1GB > #temp_buffers = 8MB > #temp_file_limit = -1 > effective_cache_size = 44GB > > > If I put a temp_file_limit …Are all my queries (who have to write on > disk) will crash ? > > As you can see… I have 64 gb of Ram, but less than 3 Gb is used ! > > ben@bdd:/home/benjamin# free -m > total used free shared buffers cached > Mem: 64456 64141 315 15726 53 61761 > -/+ buffers/cache: 2326 62130 > Swap: 1021 63 958 > > > Thanks guys for your help :) I don't see why you think you have less than 3GB used. The output you posted clearly shows there's only ~300MB memory free - there's 15GB shared buffers and ~45GB of page cache (file system cache). But you still haven't shows us the query (the EXPLAIN ANALYZE of it), so we can't really give you advice. -- Tomas Vondra http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance