Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared memory space for all workers #413

Open
khataev opened this issue Oct 29, 2019 · 1 comment
Open

Shared memory space for all workers #413

khataev opened this issue Oct 29, 2019 · 1 comment

Comments

@khataev
Copy link

khataev commented Oct 29, 2019

Hi! I'm just curious is it possible to implement such behaviour. The case is that each of my workers establishes some connection to remote server (I'm fetching emails with IMAP protocol). So I'd like to have some kind of pool of established connections in advance. I want this pool to be available to newly spawned worker, so it could fetch connection instead of connecting again and again, wasting time and resources.

@jbielick
Copy link

Do you think leveraging the connection-pool gem would help here? You could add n connections to your server into the pool for your workers to share. Then you could limit the number of concurrent connections and reuse connections as long as their alive. The connection pool can handle reconnecting and making sure the pool has sufficient resources according to your limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants