Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZHx4r-0000ct-KJ for pgsql-performance@arkaria.postgresql.org; Wed, 22 Jul 2015 16:41:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZHx4r-000554-6s for pgsql-performance@arkaria.postgresql.org; Wed, 22 Jul 2015 16:41:05 +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 1ZHx4q-00054G-4k for pgsql-performance@postgresql.org; Wed, 22 Jul 2015 16:41:04 +0000 Received: from nm30-vm6.bullet.mail.ne1.yahoo.com ([98.138.91.123]) by makus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZHx4j-0003Mh-N2 for pgsql-performance@postgresql.org; Wed, 22 Jul 2015 16:41:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1437583256; bh=QvZemPYUkZQChWWDuhwsZBIN1Xd8JP3AUGF83PEXa9w=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=B5jbrt6lRmMFn4ZQz2xuo8wuut+AKxdQFOLSFcWGa3XcpHiG2TIqN1cNfCn5D1GIVTYdURccz2W9zEdvYJPAQNOWMmhe9iw0KP/8v8cw92seEHVP88TwYIvjVKOHuWnKN6B/MT7mgp/mmXEJ0Ae0wM2HEZX49s+9Z0wakJKGRgomb1Y31RPYKEjBX5R+UJhoDW1LKoU/k98E8vMfc40MOEot39IkiWf7uA1dcrpmG/8T51s/mRVrapemNAjSaDN/lFvpnI0ZKVpfneN4+ojWjpqf0e3fuzEc+HGXUod/xAQwzRiQFf3mmOUX+DGuPInUzrb4559YTGZU04qak/b68A== Received: from [98.138.100.117] by nm30.bullet.mail.ne1.yahoo.com with NNFMP; 22 Jul 2015 16:40:56 -0000 Received: from [98.138.89.246] by tm108.bullet.mail.ne1.yahoo.com with NNFMP; 22 Jul 2015 16:40:56 -0000 Received: from [127.0.0.1] by omp1060.mail.ne1.yahoo.com with NNFMP; 22 Jul 2015 16:40:56 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 18084.44213.bm@omp1060.mail.ne1.yahoo.com X-YMail-OSG: 4nxhL8AVM1kRzqVJ8_V9Rny5FWe4OXJbL9atxV5AjdXX.vF0NSqGK4ApWzr.fYT 566BgrAbiMM28b4SfZroDNhhRhg2tC66NMTsLofSGttvB1lSfqr5Mr8CxC1M.PmF7u_h0xqFIBY9 uoyCcJdafDnoFiOp.t_VCsTsr9A0r_ytMtGK2_TecjhYG7imziQYhblJTadF28E0WgcClvqbgnmv 0rxO2gi4ufpr8gK0GtcLG12E0n8iO4DndAZPVyBVy8MzoFEZV19USnVuBnNCIy25tReiBS9gPJ8i ZJUEy0namtn9yLRJTAJHC.I1rUTl_ThCYoTnz2uX9Uq5zma8xm2rnIP1jysxzW4zujyto_udaz15 b0uxr.vOIOsW6HeGnf9CpZyHcyhNKeKV_jolkYj.6PX5G6jIVShvm2t5bPjB5oFeyG.FFpfVIilp uEWIUhvdoCqnwIVM3dgyd5sw19S2m2pkydzQLo2aqRNkQMoOe2ZdlVN2Cej7XO39P Received: by 98.138.105.252; Wed, 22 Jul 2015 16:40:55 +0000 Date: Wed, 22 Jul 2015 16:40:55 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: Moreno Andreo , "pgsql-performance@postgresql.org" Message-ID: <969868879.490578.1437583255126.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <55AF91A8.70904@evolu-s.it> References: <55AF91A8.70904@evolu-s.it> Subject: Re: How to find the culprit in server load spikes? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 1287 X-Pg-Spam-Score: -2.7 (--) 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 Moreno Andreo wrote: > I host a Postgresql server on Ubuntu 12.04 and I am facing server > load spikes (if I run top, it goes up to 25-30 on a 4-core system)... > In some cases, I have to restart potgresql service because users call us > complaining of the slowness, but in some cases I can leave things on > their way and I see that after a bunch of minutes (about 5-10) the > situations drops to the normality (0.50-2 load). > > The problem is, as in the most cases, the I/O, If you have confirmed that there is an I/O glut during these episodes, it is probably that a cascade of dirty cache pages caused the OS dirty pages to hit the vm.dirty_ratio percentage. If you were seeing a high number for system CPU time the below would probably not help. Make sure you are using a storage system that has a persistent cache configured for write-back (rather than write-through). Reduce the OS vm.dirty_background_bytes setting to less than the size of the persistent write cache. Make sure that vm.dirty_ratio is at least 20, possibly higher. Configure the PostgreSQL background writer to be more aggressive. If those don't do it, reduce the size of shared_buffers. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance