Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 9D598632204 for ; Wed, 7 Jan 2009 14:39:20 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85668-02 for ; Wed, 7 Jan 2009 14:39:15 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mail.postgresql.org (Postfix) with ESMTP id BE6C263227F for ; Wed, 7 Jan 2009 14:39:14 -0400 (AST) Received: by fg-out-1718.google.com with SMTP id 16so2885908fgg.23 for ; Wed, 07 Jan 2009 10:39:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :sender:to:subject:mime-version:content-type:x-google-sender-auth; bh=78Pen8abWj5BXYAqAYf2K/EPp1prAlfV9T2mA/TyLAM=; b=F7unjIi2q/FN98qaHDJv33GQmp5Ryf6QqPldrJ9JU5uAsa1dNRQXK0UUfCqtiRFFBk 35LHj2gpYBe8MLDBL+yIUmAEBdTRESVpWSJZCs9m/WTRdD1JMmZSTJaJaQg3YaiyPVvN Aq7ckIr1oP2UlVKxMKx5p9dQEY9tHVtmbOzkM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:sender:to:subject:mime-version :content-type:x-google-sender-auth; b=T6ZhQUGZgyDw5+Yf3fl2MrBxNfQm/BLm2qttBr6YF3CaX/1sinXxKRaqm6Yhqpkjq+ rSMY/ftnirlzSV/xujVhk2ZNFhEj3G/sDAf8MEOQDn4010VXTxoD6z520pAztu/aLn7q 0oOaCu+Ftd7T8AI+L7Gs35pAfp78sQ4LfdsdI= Received: by 10.86.84.18 with SMTP id h18mr13630826fgb.22.1231353552541; Wed, 07 Jan 2009 10:39:12 -0800 (PST) Received: by 10.86.84.6 with HTTP; Wed, 7 Jan 2009 10:39:12 -0800 (PST) Message-ID: Date: Wed, 7 Jan 2009 21:39:12 +0300 From: "Dmitry Koterov" Reply-To: dmitry@koterov.ru To: pgsql-performance@postgresql.org Subject: Are random writes optimized sequentially by Linux kernel? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_111635_23255472.1231353552076" X-Google-Sender-Auth: c5dc3c0b815525f3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200901/32 X-Sequence-Number: 32311 ------=_Part_111635_23255472.1231353552076 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello. Suppose I perform 1000 RANDOM writes into a file. These writes are saved into Linux writeback buffer and are flushed to the disc asynchronously, that's OK. The question is: will physical writes be performed later in the sequence of physical SECTOR position on the disc (minimizing head seeking)? Or Linux background writer knows nothing about physical on-disc placement and flushes data in order it is saved in the RAM? E.g., if I write in the application: a) block 835 b) block 136 c) block 956 d) block 549 e) block 942 dows the Linux background writer save flush them e.g. in physical order "136 - 549 - 835 - 942 - 956" or not? ------=_Part_111635_23255472.1231353552076 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello.

Suppose I perform 1000 RANDOM writes into a file. These writes are saved into Linux writeback buffer and are flushed to the disc asynchronously, that's OK.

The question is: will physical writes be performed later in the sequence of physical SECTOR position on the disc (minimizing head seeking)? Or Linux background writer knows nothing about physical on-disc placement and flushes data in order it is saved in the RAM?

E.g., if I write in the application:

a) block 835
b) block 136
c) block 956
d) block 549
e) block 942

dows the Linux background writer save flush them e.g. in physical order "136 - 549 - 835 - 942 - 956" or not?
------=_Part_111635_23255472.1231353552076--