List Info

Thread: Re: shared memory problem on network




Re: shared memory problem on network
country flaguser name
India
2007-08-03 09:04:36
Hi Bill/bryan et al.
 
I am running"lockerd" and have written a client script which uses IPC::Locker.
The client is able to "switch" servers (in case any one server is down using the same module.
 
Thanks guys !
 
--Ukh 

Bill Luebkert <dbecollroadrunner.com> wrote:
Brian Raven wrote:
>;
>>Hi Bill/Bryan et al.,
>&gt;
>>I was trying to implement the reader-writers locking mechanism using
>
> shared memory. I am using IPC::Shareable
>
>>to implement this.
>>The apache-instances are currently running on only an individual
>
> server (say A1) and all are able to access
>
>>this shared memory; and things work just fine.
>>
>>But on "live/production" environment, there are 4-5 servers (say, the
>
> others are A2, A3, A4 and A5
>
>>respectively); each running several instances of Apache-mod-perl.
>>
>&gt;Right now the shared memory is only on A1.
>>So if A1 goes down (due to any reason), all my other applications
>
> would be starved as the shared memory was
>
>>implemented on A1 and all instances across all the servers were
>
> accessing this shared memory.
&gt;
>>
>>Is there any way I can have a shared memory mutually accessible to all
>
> the servers?
&gt;
>>So that in case A1 goes down, some other server can take take control
&gt;
> of the shared memory.
&gt;
>>Any pointers would be much appreciated.
>
>
> AFAIK, shared memory only works for processes on the same server.

In the historical definition, that would make sense. You could, I suppose,
think of sharing memory across a network though if you stretched the def
a bit. Of course, that really complicates the locking process although
I believe there are *NIXs that have network locking implemented (haven't
played in that arena much lately).

>>From your description, what you actually want is a distributed locking
&gt; mechanism. Shared memory, i.e. how you wanted to implement it, is
> actually a red herring. If you were to search CPAN for something like
> "distributed lock" you might see a couple of modules that might help
> such as IPC::Lock and IPC::Locker. Note that they don't seem to work on
> all platforms.

If you can't find something appropriate that works on whatever platforms
you have, you could consider making a TCP lock server or data server.

What are you trying to lock (I assume some sort of data file that is
being written and read at the same time) ? and is that data available
(or could it be made available) on any of the servers ?

If you serialize the requests through a single read/write TCP server,
you shouldn't need to worry about locks (assuming that one server could
handle all the traffic).

You could make the server movable too if one server went down, you could
vote in a new one to take over and periodically update all the servers
with the historical data so they wouldn't lose much on a takeover.

Give us a bit more info of what you're sharing/locking and what platforms
you have to deal with.
_______________________________________________
ActivePerl mailing list
ActivePerllistserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

;


Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search.
Re: shared memory problem on network
country flaguser name
India
2007-08-13 00:25:30
Hi Bill/bryan et al.

I was planning to load-test my daemon service
"lockerd" which is running as the lock-server on
my
network.

I cant seem to find a starting-point on how to achieve
this. Any pointers would really help.

Best regards,
Ukh




--- ukhas jean <ukh_dtlyahoo.com> wrote:

> Hi Bill/bryan et al.
>    
>   I am running"lockerd" and have written a
client
> script which uses IPC::Locker.
>   The client is able to "switch" servers (in
case
> any one server is down using the same module.
>    
>   Thanks guys !
>    
>   --Ukh 
> 
> Bill Luebkert <dbecollroadrunner.com> wrote:
>   Brian Raven wrote:
> > 
> >>Hi Bill/Bryan et al.,
> >> 
> >>I was trying to implement the reader-writers
> locking mechanism using
> > 
> > shared memory. I am using IPC::Shareable 
> > 
> >>to implement this.
> >>The apache-instances are currently running on
only
> an individual
> > 
> > server (say A1) and all are able to access 
> > 
> >>this shared memory; and things work just fine.

> >> 
> >>But on "live/production" environment,
there are
> 4-5 servers (say, the
> > 
> > others are A2, A3, A4 and A5 
> > 
> >>respectively); each running several instances
of
> Apache-mod-perl.
> >>
> >>Right now the shared memory is only on A1. 
> >>So if A1 goes down (due to any reason), all my
> other applications
> > 
> > would be starved as the shared memory was 
> > 
> >>implemented on A1 and all instances across all
the
> servers were
> > 
> > accessing this shared memory.
> > 
> >> 
> >>Is there any way I can have a shared memory
> mutually accessible to all
> > 
> > the servers?
> > 
> >>So that in case A1 goes down, some other
server
> can take take control
> > 
> > of the shared memory.
> > 
> >>Any pointers would be much appreciated.
> > 
> > 
> > AFAIK, shared memory only works for processes on
> the same server.
> 
> In the historical definition, that would make sense.
> You could, I suppose,
> think of sharing memory across a network though if
> you stretched the def
> a bit. Of course, that really complicates the
> locking process although
> I believe there are *NIXs that have network locking
> implemented (haven't
> played in that arena much lately).
> 
> >>From your description, what you actually want
is a
> distributed locking
> > mechanism. Shared memory, i.e. how you wanted to
> implement it, is
> > actually a red herring. If you were to search
CPAN
> for something like
> > "distributed lock" you might see a
couple of
> modules that might help
> > such as IPC::Lock and IPC::Locker. Note that they
> don't seem to work on
> > all platforms.
> 
> If you can't find something appropriate that works
> on whatever platforms
> you have, you could consider making a TCP lock
> server or data server.
> 
> What are you trying to lock (I assume some sort of
> data file that is
> being written and read at the same time) ? and is
> that data available
> (or could it be made available) on any of the
> servers ?
> 
> If you serialize the requests through a single
> read/write TCP server,
> you shouldn't need to worry about locks (assuming
> that one server could
> handle all the traffic).
> 
> You could make the server movable too if one server
> went down, you could
> vote in a new one to take over and periodically
> update all the servers
> with the historical data so they wouldn't lose much
> on a takeover.
> 
> Give us a bit more info of what you're
> sharing/locking and what platforms
> you have to deal with.
> _______________________________________________
> ActivePerl mailing list
> ActivePerllistserv.ActiveState.com
> To unsubscribe:
> http:/
/listserv.ActiveState.com/mailman/mysubs
> 
> 
>        
> ---------------------------------
> Luggage? GPS? Comic books? 
> Check out fitting  gifts for grads at Yahoo!
Search.>
_______________________________________________
> ActivePerl mailing list
> ActivePerllistserv.ActiveState.com
> To unsubscribe:
http:/
/listserv.ActiveState.com/mailman/mysubs



       
____________________________________________________________
________________________
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.c
om/collections/222
_______________________________________________
ActivePerl mailing list
ActivePerllistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )