in reply to Synchronizing variables (in mod_perl) across Apache instances?

You might have luck with the IPC::Shareable module. I tried it a while ago, but had trouble with storing a lot of data and occasionally stuffing a coderef in there.

It doesn't sound like you'll have either limitation.

  • Comment on Re: Synchronizing variables (in mod_perl) across Apache instances?

Replies are listed 'Best First'.
Re (tilly) 2: Synchronizing variables (in mod_perl) across Apache instances?
by tilly (Archbishop) on Apr 20, 2001 at 15:36 UTC
    Depending on the variable, I would be suspicious of whether IPC::Shareable is a net win.

    Sure, the database is a point of contention in the site.

    However shared memory that you access frequently can quickly become a bigger one. And any design based on using shared memory cannot be scaled by running on multiple machines. Given the scalability implications of that statement, I would work to avoid shared memory without first doing a detailed evaluation of why I thought it fit my problem.

    And if I was going to use it anyways I would be inclined to hide it in a function call in a module that would memoize it upon first access in an interpreter. In other words I would work to make it as small a point of contention as possible.

    FWIW I met Rusty (of Kuro5hin) last summer, and when he mentioned he was using IPC::Shareable in the released site this was my gut reaction. And indeed when his site was re-released and hit load, guess what component caused it to fall over?