Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YsunZ-0002p4-2S for pgsql-admin@arkaria.postgresql.org; Thu, 14 May 2015 15:11:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YsunY-0000xS-6w for pgsql-admin@arkaria.postgresql.org; Thu, 14 May 2015 15:11:44 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YsunX-0000xL-F5 for pgsql-admin@postgresql.org; Thu, 14 May 2015 15:11:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1YsunU-0000f0-SI for pgsql-admin@postgresql.org; Thu, 14 May 2015 15:11:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t4EFBW72020589; Thu, 14 May 2015 11:11:32 -0400 From: Tom Lane To: Ravi Krishna cc: pgsql-admin@postgresql.org Subject: Re: WAL and O_DIRECT In-reply-to: <14d52f362c9-2108-309cd@webstg-m03.mail.aol.com> References: <14d52f362c9-2108-309cd@webstg-m03.mail.aol.com> Comments: In-reply-to Ravi Krishna message dated "Thu, 14 May 2015 11:03:11 -0400" Date: Thu, 14 May 2015 11:11:32 -0400 Message-ID: <20588.1431616292@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Ravi Krishna writes: > Why is O_DIRECT not used, despite the documentation mentioning otherwise? You've not shown us all your settings, but this comment in xlog.c might explain it: * Optimize writes by bypassing kernel cache with O_DIRECT when using * O_SYNC/O_FSYNC and O_DSYNC. But only if archiving and streaming are * disabled, otherwise the archive command or walsender process will read * the WAL soon after writing it, which is guaranteed to cause a physical * read if we bypassed the kernel cache. We also skip the * posix_fadvise(POSIX_FADV_DONTNEED) call in XLogFileClose() for the same * reason. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin