IPC::Shareable size of hash in shared memory or different approach to shared memory


I used IPC::Shareable module for my simple webserver solution for three years now. I find it very useful but the module hasn't been updated a while (version 0.6 is more than 3 years old). Anyway I use this module so that server (parent) stores some data into hash and then ties it into the shared memory to which all childs have access. But the default size of shared memory with this module is  65536 bytes and my hash just got bigger so when I try to build this hash I get following error:

Could not create semaphore set: No space left on device
 at lib/Server.pm line 170

And when I tried to change the size in options:

my %options = (
create    => 1,
exclusive => 0,
mode      => 0644,
DESTROY   => 1,
size      =>  (IPC::Shareable::SHM_BUFSIZ() * 2)

tie %Data, 'IPC::Shareable', "data", { %options };

Now I get following error:

IPC::Shareable::SharedMem: shmget: Invalid argument
 at /usr/local/ActivePerl-5.8/lib/site_perl/5.8.3/IPC/Shareable.pm line 566
Could not create shared memory segment:
 at lib/Server.pm line 165

I tried to contact author of this module but his address on CPAN doesn't exist anymore. So does anyone here have an idea how I can fix this problem or is there perhaps any better (newer) solution for tying hashes in shared memory out there?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

http://search.cpan.org/~maurice/IPC-ShareLite-0.09/ShareLite.pm tells me:

IPC::ShareLite provides a simple interface to shared memory, allowing data to be efficiently communicated between processes. Your operating system must support SysV IPC (shared memory and semaphores) in order to use this module.

IPC::ShareLite provides an abstraction of the shared memory and semaphore facilities of SysV IPC, allowing the storage of arbitrarily large data; the module automatically acquires and removes shared memory segments as needed. Storage and retrieval of data is atomic, and locking functions are provided for higher-level synchronization.

In many respects, this module is similar to IPC::Shareable. However, IPC::ShareLite does not provide a tied interface, does not (automatically) allow the storage of variables, and is written in C for additional speed.
http://search.cpan.org/~samtregar/IPC-SharedCache-1.3/SharedCache.pm tells me:

This module provides a shared memory cache accessed as a tied hash. [...] This module handles all shared memory interaction using the IPC::ShareLite module (version 0.06 and higher) and all data serialization using Storable. See IPC::ShareLite and Storable for details.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.