shared memory problem on network

shared memory problem on network

am 23.07.2007 15:02:15 von ukhas jean

--===============0409200624==
Content-Type: multipart/alternative; boundary="0-1764555266-1185195735=:95859"
Content-Transfer-Encoding: 7bit

--0-1764555266-1185195735=:95859
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Bill/Bryan et al.,
=20
I was trying to implement the reader-writers locking mechanism using sh=
ared 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 ju=
st fine.=20
=20
But on "live/production" environment, there are 4-5 servers (say, the o=
thers are A2, A3, A4 and A5 respectively); each running several instances=
of Apache-mod-perl.

Right now the shared memory is only on A1.=20
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.
=20
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.
=20
Thanks n regrds,
Ukh
=20

=20
---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's =
on, when.=20
--0-1764555266-1185195735=:95859
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Bill/Bryan et al.,
 
I was tryi=
ng to implement the reader-writers locking mechanism using shared me=
mory. I am using IPC::Shareable to implement this.
The apache-instance=
s are currently running on only an individual server (say A1) and all are=
able to access this shared memory; and things work just fine.
iv> 
But on "live/production" environment, there are 4-5=
servers (say, the others are A2, A3, A4 and A5 respectively); each runni=
ng several instances of Apache-mod-perl.
Right now the sh=
ared memory is only on A1.
So if A1 goes down (due to any re=
ason), all my other applications would be starved as the shared memory wa=
s implemented on A1 and all instances across all the servers were accessi=
ng this shared memory.
 
Is there any way I =
can have a shared memory mutually accessible to all the servers?
So th=
at in case A1 goes down, some other
server can take take control of the shared memory.
Any pointers would=
be much appreciated.
 
Thanks n regrds, v>
Ukh
 



Sick sense of humor? Visit Yahoo! TV's=20
tions/222">Comedy with an Edge to see what's on, when.=20



--0-1764555266-1185195735=:95859--

--===============0409200624==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0409200624==--

RE: shared memory problem on network

am 23.07.2007 16:11:31 von Brian Raven

From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of ukhas
jean
Sent: 23 July 2007 14:02
To: Active Perl
Subject: shared memory problem on network

> 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.

>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.

HTH

-- =

Brian Raven =


==================== =====3D=
================
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
================

The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =

Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.

L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
==================== =====3D=
================

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: shared memory problem on network

am 23.07.2007 16:46:04 von Bill Luebkert

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
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: shared memory problem on network

am 24.07.2007 09:33:34 von ukhas jean

--===============1022158116==
Content-Type: multipart/alternative; boundary="0-111979846-1185262414=:71580"
Content-Transfer-Encoding: 7bit

--0-111979846-1185262414=:71580
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi, Bill/bryan et al.,
=20
The platforms used on the 5 servers (say, A1 to A5) are all flavors of Li=
nux.
We have a CMS in place; and the content is stored as parent-child relatio=
ns in a hash;
I m trying to lock this hash, so that when one user is editing content =
(say, like a textbox on a page, say form1), no other user should be able =
to modify this hash; lest we have inconsistent entries. In my case 120 se=
cs is the maximum time a user can lock a resource (for writing);
Shared memory works fine ( n superfast too) when all the apache-instanc=
es are on one server (say A1). But as part of risk-analysis, I have to co=
nsider the scenario "what if A1 goes down?? Shouldnt any of the other ser=
vers A2 to A5 handle user-driven hits meanwhile??"
I hadnt considered this scenario when designing. This is a major choke =
as of now.=20
Would you be requiring any more details Bill??=20

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


=20
---------------------------------
Boardwalk for $500? In 2007? Ha!=20
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! G=
ames.
--0-111979846-1185262414=:71580
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi, Bill/bryan et al.,

The platforms used on the 5 s=
ervers (say, A1 to A5) are all flavors of Linux.
We have a CMS in plac=
e; and the content is stored as parent-child relations in a hash;
=
I m trying to lock this hash, so that when one user is editing conte=
nt (say, like a textbox on a page, say form1), no other user should be ab=
le to modify this hash; lest we have inconsistent entries. In my case 120=
secs is the maximum time a user can lock a resource (for writing);
=
Shared memory works fine ( n superfast too) when all the apache-in=
stances are on one server (say A1). But as part of risk-analysis, I have =
to consider the scenario "what if A1 goes down?? Shouldnt any of the othe=
r servers A2 to A5 handle user-driven hits meanwhile??"
I had=
nt considered this scenario when designing. This is a major choke as of n=
ow.
Would you be requiring any more details Bill??

best, >
Ukh

Bill
Luebkert <dbecoll@roadrunner.com>
wrote:
E class=3Dreplbq style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEF=
T: #1010ff 2px solid">Brian Raven wrote:
>
>>Hi Bill/Brya=
n et al.,
>>
>>I was trying to implement the reader-wr=
iters locking mechanism using
>
> shared memory. I am using =
IPC::Shareable
>
>>to implement this.
>>The apa=
che-instances are currently running on only an individual
>
>=
; server (say A1) and all are able to access
>
>>this sh=
ared 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); ea=
ch running several instances of Apache-mod-perl.
>>
>>R=
ight 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 s=
ervers were
>
> accessing this shared memory.
>
&g=
t;>
>>Is there any way I can have a shared memory mutually a=
ccessible to all
>
> the servers?
>
>>So tha=
t in case A1 goes down, some other server can take take control
> <=
BR>> of the shared memory.
>
>>Any pointers would be m=
uch appreciated.
>
>
> AFAIK, shared memory only work=
s for processes on the same server.

In the historical definition, =
that would make sense. You could, I suppose,
think of sharing memory a=
cross 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 are=
na 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
&g=
t; actually a red herring. If you were to search CPAN for something like<=
BR>> "distributed lock" you might see a couple of modules that might h=
elp
> such as IPC::Lock and IPC::Locker. Note that they don't seem =
to work on
> all platforms.

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

What are you trying to lo=
ck (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 avail=
able) on any of the servers ?

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

Yo=
u could make the server movable too if
one server went down, you could
vote in a new one to take over and pe=
riodically update all the servers
with the historical data so they wou=
ldn'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
=
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.Ac=
tiveState.com/mailman/mysubs



Boardwalk for $500? In 2007? Ha!
/us.rd.yahoo.com/evt=3D48223/*http://get.games.yahoo.com/pro ddesc?gamekey=
=3Dmonopolyherenow">Play Monopoly Here and Now
(it's updated for toda=
y's economy) at Yahoo! Games.
--0-111979846-1185262414=:71580--

--===============1022158116==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1022158116==--

Re: shared memory problem on network

am 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c3Vicw==

Re: shared memory problem on network

am 03.08.2007 16:04:36 von ukhas jean

--===============1136147051==
Content-Type: multipart/alternative; boundary="0-1163220268-1186149876=:58769"
Content-Transfer-Encoding: 7bit

--0-1163220268-1186149876=:58769
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Bill/bryan et al.
=20
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.
=20
Thanks guys !
=20
--Ukh=20

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


=20
---------------------------------
Luggage? GPS? Comic books?=20
Check out fitting gifts for grads at Yahoo! Search.
--0-1163220268-1186149876=:58769
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Bill/bryan et al.
 
I am running"loc=
kerd" and have written a client script which uses IPC::Locker.
v>The client is able to "switch" servers (in case any one server is down =
using the same module.
 
Thanks guys !<=
/div>
 
--Ukh 

Bill Luebkert <=
;dbecoll@roadrunner.com>
wrote:
lbq style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2p=
x solid">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::Shareabl=
e
>
>>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.
>&g=
t;So if A1 goes down (due to any reason), all my other applications
&g=
t;
> would be starved as the shared memory was
>
>&g=
t;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 d=
own, some other server can take take control
>
> of the shar=
ed 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,
t=
hink of sharing memory across a network though if you stretched the def R>a bit. Of course, that really complicates the locking process although<=
BR>I believe there are *NIXs that have network locking implemented (haven=
't
played in that arena much lately).

>>From your descrip=
tion, 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
> "dist=
ributed lock" you might see a couple of modules that might help
> s=
uch 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 c=
ould it be made available) on any of the servers ?

If you serializ=
e the requests through a single read/write TCP server,
you shouldn't n=
eed to worry about locks (assuming that one server could
handle all th=
e traffic).

You could make the server movable too if one server we=
nt down, you could
vote in a new one to take over and periodically upd=
ate all the servers
with the historical data so they wouldn't lose muc=
h on a takeover.

Give us a bit more info of what you're sharing/lo=
cking and what platforms
you have to deal with.
___________________=
____________________________
ActivePerl mailing list
ActivePerl@lis=
tserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/=
mailman/mysubs



Luggage? GPS? Comic books?

Check out fitting earch.yahoo.com/search?fr=3Doni_on_mail&p=3Dgraduation+gifts &cs=3Dbz"> gi=
fts for grads
at Yahoo! Search.
--0-1163220268-1186149876=:58769--

--===============1136147051==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1136147051==--

Re: shared memory problem on network

am 13.08.2007 07:25:30 von ukhas jean

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 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 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
> ActivePerl@listserv.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
> ActivePerl@listserv.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.com/collections/222
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs