in reply to Persistent memory with mod_perl and a module.

As noted above, each apache child process has its own copy of the ModCounter package and $cnt variable. A couple suggestions:

1) Store the counter in a database. This is often the easiest method if your script is database driven anyway.

2) Use one of the shared memory modules from CPAN.

  • Comment on Re: Persistent memory with mod_perl and a module.

Replies are listed 'Best First'.
Re: Re: Persistent memory with mod_perl and a module.
by perrin (Chancellor) on Oct 19, 2002 at 18:50 UTC
    With the exception of IPC::MM, those shared memory modules are very slow. You would be better off using MLDBM::Sync or Cache::FileCache.