Unix Technical Forum

Shared memory and memory context question

This is a discussion on Shared memory and memory context question within the pgsql Hackers forums, part of the PostgreSQL category; --> On Mon February 6 2006 05:17, Mark Woodward wrote: > I posted some source to a shared memory sort ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 04-11-2008, 07:55 AM
Richard Hills
 
Posts: n/a
Default Re: Shared memory and memory context question

On Mon February 6 2006 05:17, Mark Woodward wrote:
> I posted some source to a shared memory sort of thing to the group, as
> well as to you, I believe.


Indeed, and it looks rather interesting. I'll have a look through it when I
have a chance...

So, after more discussion and experimentation, the possible methods in order
of +elegance/-difficulty/-complexity are:

=1. OSSP supported shared mem, possibly with a pg memory context or Mark's
shared memory manager.
=1. Separate application which the postgres backends talk to over tcp (which
actually turns out to be quite a clean way of doing it).
3. Storing rules in db and reloading them each time (which turns out to be a
utter bastard to do).
4. Shared memory with my own memory manager.

I am *probably* going to go for the separate network application, as I
believe this is easy and relatively clean, as the required messages should be
fairly straightforward. Each postgres backend opens a connection to the
single separate "rules-server" which sends back a serious of commands
(probably SQL), before the connection is closed again.

If this is Clearly Insane - please let me know!

Regards,

Richard

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 04-11-2008, 07:55 AM
Mark Woodward
 
Posts: n/a
Default Re: Shared memory and memory context question

> On Mon February 6 2006 05:17, Mark Woodward wrote:
>> I posted some source to a shared memory sort of thing to the group, as
>> well as to you, I believe.

>
> Indeed, and it looks rather interesting. I'll have a look through it when
> I
> have a chance...
>
> So, after more discussion and experimentation, the possible methods in
> order
> of +elegance/-difficulty/-complexity are:
>
> =1. OSSP supported shared mem, possibly with a pg memory context or Mark's
> shared memory manager.
> =1. Separate application which the postgres backends talk to over tcp
> (which
> actually turns out to be quite a clean way of doing it).


If you hop on over to http://www.mohawksoft.org, you'll see a server
application called "MCache." MCache is written to handle *exactly* the
sort of information you are looking to manage. Its primary duty is to
manage highly concurrent/active sessions for a large web cluster. I have
also been working on a PostgreSQL extension for it. It needs to be fleshed
out and, again, some heavy duty QA, but "works on my machine."

I alluded to releasing an extension module for PostgreSQL, I'm actually
working on a much larger set of projects intended to tightly integrate
PostgreSQL, web servers (PHP right now), and a set of service applications
including search and recommendations. In another thread I wanted to add an
extension, "xmldbx," to postgresql's contrib dir. Anyway, I digress.

If anyone is interested in lending a hand in QA, examples, and so on, I'd
be glad to take this off line.


> 3. Storing rules in db and reloading them each time (which turns out to be
> a
> utter bastard to do).
> 4. Shared memory with my own memory manager.


If you have time and the inclanation to so, it is a fund sort of thing to
write.

>
> I am *probably* going to go for the separate network application, as I
> believe this is easy and relatively clean, as the required messages should
> be
> fairly straightforward. Each postgres backend opens a connection to the
> single separate "rules-server" which sends back a serious of commands
> (probably SQL), before the connection is closed again.
>
> If this is Clearly Insane - please let me know!


It isn't a bad idea at all. For MCache, I leave the socket connection open
for the next use of the PostgreSQL session. Web environments usually keep
a cache of active database connections to save the overhead of connecting
each time. You just need to be careful when you clean up.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:57 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com