question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why not using multiprocessing.Manager().dict() ?

See original GitHub issue

Hello,

it would be nice if the README would describe the reason for this project. As there is already multiprocessing.Manager().dict() in the stdlib which does the same?! Is this significantly easier or faster than the multiprocessing library?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
drgarcia1986commented, Nov 4, 2020

Hi @spaceone thanks for the comment.

We create this project to provide an alternative for distributed cache servers (like Redis) for some ephemeral data that we can share between our gunicorn/uwsgi workers across some k8s pods, but still in the experimental stage.

About multiprocessing.Manager().dict(), according to python docs:

Sharing data directly via memory can provide significant performance benefits compared to sharing data via disk or socket or other communications requiring the serialization/deserialization and copying of data.

And (IMO) multiprocessing.shared_memory it’s easier to use in our scenarios

Did you already use multiprocessing.Manager().dict() across gunicorn/uWSIG workers? I’d love to see some examples and perform some benchmarks.

1reaction
spaceonecommented, Nov 11, 2020

btw. I expected multiprocessing.Manager().dict() to be shared memory, but it seems it creates a UNIX socket and runs a server in a thread. I can’t give you any benchmarks as I don’t work with gunicorn/uWSGI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manager dict in Multiprocessing - python - Stack Overflow
@crysis405 I fixed that. Looks like manager's dict is not fully dumped while transfering between processes, so we need to replace original value ......
Read more >
multiprocessing — Process-based parallelism — Python 3.11 ...
A manager object returned by Manager() controls a server process which holds Python objects and allows other processes to manipulate them using proxies....
Read more >
Cannot modify dictionaries inside dictionaries using Managers ...
It's not possible to modify a dict inside a dict using a manager from multiprocessing. ... The output is the same if you...
Read more >
Question about multiprocessing.Manager().dict() : r/learnpython
For those unfamiliar, multiprocessing.Manager is a class that wraps a mutex around specific objects you want to share and transfers them between ...
Read more >
Python multiprocessing.Manager() Examples
This page shows Python examples of multiprocessing.Manager. ... def test_init(): manager = Manager() return_dict = manager.dict() # make server init before ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found