Re: Using Threads?

From: Alfred Perlstein <bright(at)wintelcom(dot)net>
To: Myron Scott <mscott(at)sacadia(dot)com>
Cc: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Using Threads?
Date: 2001-01-02 17:24:25
Message-ID: 20010102092425.M19572@fw.wintelcom.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Myron Scott <mscott(at)sacadia(dot)com> [010102 08:47] wrote:
>
>
> Alfred Perlstein wrote:
>
>
> >
> > It's possible what you're seeing is the entire process
> > wait for a disk IO to complete.
> >
> > I'm wondering, how many lwps does your system use? Are all
> > the threads bound to a single lwp or do you let the threads
> > manager handle this all for you?
> >
>
> Yeah, I looked at this. I have one thread per process that
> does all flushing of buffer pages at transaction commit.
> The client threads register buffer writes with this thread and
> wait for this thread to complete writes
> at transaction end. Unfortuately, selects also wait which really
> isn't nessessary. I hoped this would speed
> simultaneous connections. I created this as both
> a bound thread with its own lwp and a threads manager
> managed thread. I eventually settled on a threads manager
> managed thread, thinking that I wanted to set the priority
> of this thread low and commit as many transactions as
> possible simulateously. Maybe, I should rethink this.
>
> As for client threads, that is managed by TAO and I
> haven't really played with that configuration.

I think you're saying you have an lwp in what you used to
be per-process context? Meaning if you have 4 connections,
you should have 4 lwps doing disk IO?

If that's true, most likely your problems may be elsewhere,
but since you seem to be overcaching your writes you may
be pessimizing the writes. I wouldn't try to buffer it all,
instead I would hold off until a write is done that isn't
contiguous to the last write position and then being a flush
operation.

--
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
"I have the heart of a child; I keep it in a jar on my desk."

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-01-02 17:48:56 Re: [HACKERS] Re: Inheritance docs error.
Previous Message Peter Eisentraut 2001-01-02 17:14:01 NetBSD libedit (Re: GNU readline and BSD license)