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

Updates vs shared memory #14

Closed
pySilver opened this issue Oct 28, 2020 · 3 comments
Closed

Updates vs shared memory #14

pySilver opened this issue Oct 28, 2020 · 3 comments

Comments

@pySilver
Copy link

What would be the correct behaviour to handle updates when database is used in shared memory mode?

There is a long running set of gunicorn processes that uses ip2location database in shared memory mode and some side job that updates database file periodically. Does mmap hanles updates itself or its developer responsibility to re-read database?

@chrislim2888
Copy link
Owner

Hi pySilver,

Mmap cached the database into the memor. Hence the developer will be required to restart the process to allow the mmap to cache the database again.

@pySilver
Copy link
Author

pySilver commented Nov 2, 2020

Since its a global shared variable it's possible to attach a datetime property to it, so one can store shared variable creation time and refresh it from time to time :)

@chrislim2888
Copy link
Owner

Hi pySilver,

We appreciate your feedback on this. However, we do not have plan to implement a new datetime value due to the BIN database is monthly update basis.

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