Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uz9Xs-0001sV-As for pgsql-admin@arkaria.postgresql.org; Tue, 16 Jul 2013 18:00:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Uz9Xr-0005le-QI for pgsql-admin@arkaria.postgresql.org; Tue, 16 Jul 2013 18:00:15 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uz9Xp-0005it-Tb for pgsql-admin@postgresql.org; Tue, 16 Jul 2013 18:00:14 +0000 Received: from nm4-vm1.bullet.mail.ird.yahoo.com ([77.238.189.201]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Uz9Xl-0005dZ-42 for pgsql-admin@postgresql.org; Tue, 16 Jul 2013 18:00:13 +0000 Received: from [77.238.189.239] by nm4.bullet.mail.ird.yahoo.com with NNFMP; 16 Jul 2013 18:00:07 -0000 Received: from [46.228.39.105] by tm20.bullet.mail.ird.yahoo.com with NNFMP; 16 Jul 2013 18:00:07 -0000 Received: from [127.0.0.1] by smtp142.mail.ir2.yahoo.com with NNFMP; 16 Jul 2013 18:00:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s1024; t=1373997607; bh=awKSN3a1LBwe1brW4LAehCpgwsP+PCtuiATQBzA+pf0=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Date:From:To:Subject:Message-Id:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; b=B2F9wAMY3X+e8A9uCvPwtl3ns18xQyn+CL/ME/LgFUUUUJyFYi0Y0BY20uOuzy8QoMLIk2+XL1Q2OJUg4XdnHnDEFR2XTiIZBB1qyDv3bJkFnWlpx8TLGz66YTu6Utm77i3fdjVHGB3kUJ2QtcrOEF1M81cst77yoLW+7MSLboc= X-Yahoo-Newman-Id: 501571.86843.bm@smtp142.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: te.lzXMVM1mGvmv7e41FY9QRAC1u7yONt502T7ZbU789ruw ctIAmfDGFBthU6GqeBpsaTGgj_pct1zRbOrpb.u2svG.y0o1MBR_ysXqeR2j EmpAhopoR1aGR0fpecZc_wtzqV5QMXJVIJPn1v6V0KmPBEGlPMoI7IhxkoSr gc8MVk.QmCeWTAjfcaydKV2J4ImdM2lZHwVdo6q0KL1CS__3pG2Zb2a1FeC2 JV0nSAm6KfVWT5zc2tdLXiYwtjpHAb6nDw3CS_Qhv9kb_QMKUoSTiGF_KGbC 8kKcu2inP989ZwMt_tKvI3KapQiuo063xkl_IsKWqouljTDzqaJ7N_KYkoPn ogrg5hJRegA14WvspJblYv8LFsg0Xb8cH1nWpttFKkLLM2NGaaXrAZ0Mf3cf l9jaCcA7Glx2YnCJNQKbSTsqYo0tXmusjpnzE3oDaHpy1g2VGKYL2m.CkdrO fIFgYmZFcM.i2A1577gSqS1eAOMnDWcfa6Iaa_GjrbuKTYvf47G8q_btLL8X oVCTyq1PlcrMzAj9jm3Sjy6fmgxsrGa5ItnLCz.yipnIQaZdl6cCI5kt_UCi gvVN.afBEjKWHB85snnaLzn2J6_WhEIpw91xC06BBZXhQhL7bUA1SlZ0CHmQ q X-Yahoo-SMTP: mX392iiswBAeJNdO_s.EW62LZDJR X-Rocket-Received: from drago.emorras.eu (emorrasg@89.7.216.154 with ) by smtp142.mail.ir2.yahoo.com with SMTP; 16 Jul 2013 18:00:07 +0000 UTC Date: Tue, 16 Jul 2013 19:58:34 +0200 From: Eduardo To: pgsql-admin@postgresql.org Subject: Re: 9.2.2 - semop hanging Message-Id: <20130716195834.8fe5c79249cb2ff0d4270b3e@yahoo.es> In-Reply-To: References: <1373915521.40153.YahooMailNeo@web162901.mail.bf1.yahoo.com> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.24.19; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.1 (/) 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 On Tue, 16 Jul 2013 10:08:49 -0300 Rafael Domiciano wrote: > First of all, Thanks for response, answers below. > > > On Mon, Jul 15, 2013 at 4:12 PM, Kevin Grittner wrote: > > > Rafael Domiciano wrote: > > > > > PostgreSQL 9.2.2 on x86_64-unknown-linux-gnu, compiled by gcc > > > (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4), 64-bit > > > > > CentOS release 6.3 (Final) > > > > > Since 2 weeks I'm get stucked in a very strange situation: from > > > time to time (sometimes with intervals less than 10 minutes), the > > > server get "stucked"/"hang" (I dont know how to call it) and > > > every connections on postgres (dont matter if it's SELECT, > > > UPDATE, DELETE, INSERT, startup, authentication...) seems like > > > get "paused"; after some seconds (say ~10 or ~15 sec, sometimes > > > less) everything "goes OK". > > > > During these episodes, do you see high system CPU time? If so, try > > disabling transparent huge page support, and see whether it affects > > the frequency or severity of the episodes. > > > Yeah, disabling THP seens to lower the severity of the situation. Thanks. > Right now is about 1 hour without any episode. > Same problem here and same resolution: > http://dba.stackexchange.com/questions/32890/postgresql-pg-stat-activity-shows-commit > . > > Googling I've found that others had the same problem, and resolved > disabling THP. Is it the right way? Why don't try to configure THP for your needs? It looks like the transparent manager tries to defrag memory when it's too late to do it fast because there's not enough free memory, and that it may have a default configuration bad for you. A fast search in postgresql source code gets no MADV_HUGEPAGE, so THP can't be set to process those pages only and must be configured for all system. Set THP on, #echo always >/sys/kernel/mm/transparent_hugepage/enabled get the values from and try to find and set better values: /sys/kernel/mm/transparent_hugepage/khugepaged/pages_to_scan (how many pages should scan at each pass) /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs (how many milisecs spend each pass) /sys/kernel/mm/transparent_hugepage/khugepaged/alloc_sleep_millisecs (how many milisecs between pass) khugepaged daemon is similar to our autovaccum, it should be "easy" find a local optimun values alternatively you can disable the defrag, but this way you will end losing a lot of memory in due to fragmentation: #echo never >/sys/kernel/mm/transparent_hugepage/defrag Once the values are setted, Postgres must be restarted. > About the disks activity, my parameter is the test that was did when the > storage was installed/configured. At that test iostat was around ~600 tps. > In my episodes tps was around ~300 tps. > > The Processors is 2x Intel Xeon E5-2690, giving a total of 32 threads. > > About shared_buffers, I going to try different values and test. > > Thanks, > Rafael Domiciano -- Eduardo -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin