X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D50209DCC37 for ; Tue, 29 Nov 2005 01:21:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09942-09 for ; Tue, 29 Nov 2005 01:21:00 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from toad.mtbrook.bozemanpass.com (toad.mtbrook.bozemanpass.com [69.145.82.195]) by postgresql.org (Postfix) with ESMTP id D3D3C9DCAB3 for ; Tue, 29 Nov 2005 01:20:58 -0400 (AST) Received: from [69.145.82.253] (unknown [69.145.82.253]) by toad.mtbrook.bozemanpass.com (Postfix) with ESMTP id 915B311027B for ; Mon, 28 Nov 2005 21:20:58 -0800 (PST) Message-ID: <438BE53B.1090106@boreham.org> Date: Mon, 28 Nov 2005 22:20:59 -0700 From: David Boreham User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-hackers@postgresql.org Subject: Re: ice-broker scan thread References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------050800010703040302050000" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.001 required=5 tests=[AWL=-0.000, HTML_MESSAGE=0.001] X-Spam-Score: 0.001 X-Spam-Level: X-Archive-Number: 200511/1463 X-Sequence-Number: 76745 This is a multi-part message in MIME format. --------------050800010703040302050000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Qingqing Zhou wrote: >On Mon, 28 Nov 2005, Gavin Sherry wrote: > > >>MySQL, Oracle and others implement read-ahead threads to simulate async IO >>'pre-fetching'. >> >> > >Due to my tests on Windows (using the attached program and change >enable_aio=true), seems aio doesn't help as a separate thread - but maybe >because my usage is wrong ... > > I don't think your NT overlapped I/O code is quite right. At least I think it will issue reads at a high rate without waiting for any of them to complete. Beyond some point that has to give the kernel gut-rot. But anyway, I wouldn't expect the use of aio to make any significant difference in an already threaded test program. The point of aio is to allow I/O concurrency _without_ the use of threads or multiple processes. You could re-write your program to have a single thread but use aio. In that case it should show the same read ahead benefit that you see with the thread. --------------050800010703040302050000 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Qingqing Zhou wrote:
On Mon, 28 Nov 2005, Gavin Sherry wrote:
  
MySQL, Oracle and others implement read-ahead threads to simulate async IO
'pre-fetching'.
    

Due to my tests on Windows (using the attached program and change
enable_aio=true), seems aio doesn't help as a separate thread - but maybe
because my usage is wrong ...
  
I don't think your NT overlapped I/O code is quite right. At least
I think it will issue reads at a high rate without waiting for any of them
to complete. Beyond some point that has to give the kernel gut-rot.
But anyway, I wouldn't expect the use of aio to make any
significant difference in an already threaded test program.
The point of aio is to allow
I/O concurrency _without_ the use of threads or multiple processes.
You could re-write your program to have a single thread but use aio.
In that case it should show the same read ahead benefit that you see
with the thread.



--------------050800010703040302050000--