Re: this is in plain text (row level locks) - Mailing list pgsql-hackers

From Sailesh Krishnamurthy
Subject Re: this is in plain text (row level locks)
Date
Msg-id bxyllunmt7q.fsf@datafix.cs.berkeley.edu
Whole thread Raw
In response to Re: this is in plain text (row level locks)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
   Tom> Sailesh Krishnamurthy <sailesh@cs.berkeley.edu> writes:   >> We implemented a Shared Memory MemoryContext using
OSSPlibmm   >> (used in Apache) for TelegraphCQ.
 
   Tom> How portable is that?  What kind of real-world performance do   Tom> you get?

As portable as libmm I guess. We've only tried it on Linux and MacOS
X. I understand that the Apache guys use it - so it should be fairly
portable. 

http://www.ossp.org/pkg/lib/mm/

Actually I've also tried it successfully on SPARC Solaris. 

I believe that a user of our first TelegraphCQ release (that we did
not announce) tried it on FreeBSD. Sean Chittenden has tried it on
FreeBSD but I'm not sure if he built it and got it to work properly.

As for our SHMemoryContext code itself, it's pretty much a straight
copy of the code in aset.c and mctx.c, with appropriate changes where
we call the mm_alloc functions and also use mm_lock and mm_unlock for
protection. 

As for performance, I'm in the midst of a performance study, but it's
not a micro-benchmark of the shmem allocator. After I get some numbers
I'll start profiling our code.

One problem is that on some platforms the locking implementation uses
the file-system. This is not in our control and we just trust mm to do
the best possible. 

Given that we rely on shared query execution (we run multiple queries
in a single adaptive query plan) we don't have much choice - we must
rely on shared memory.

-- 
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh




pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: v7.3.4 bundled ...
Next
From: Sailesh Krishnamurthy
Date:
Subject: Re: this is in plain text (row level locks)