Reputation: 59
We have a PSGI script using UWSGI with multi processes and threads, looking for a fast solution to share editable hashes between these processed and threads. I did tests by using in-memory storage like Cache::Memcached::Fast and Redis.
There are fast but not fast enough, compared using just a locale hash
my %hash = ();
which is up to 10 times faster during our tests. Is there a way to share and editable variables in run time - like having sort of a local hash scenario - , e.g. that process 1 is updating
$hash{$id} = $new_val;
and process 2 has also that new value for $hash{$id}?
I also tried IPC::Shareable, MCE::Shared::Minidb or threads::shared (threads::shared: segment memory limit) which did work for the PSGI.
Is there a way to have FAST - editable - local variables between all processes on the same machine shared?
Upvotes: 2
Views: 111