-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Improve database accesses #71
Comments
Hi @hanoii, Thanks for raising this issue. As of now, preforming the import action will do the following:
And in that last step is probably where most DB requests happen. As for each single config that is imported we do the following:
It goes without saying that there is much room for improvement here. Some things more obvious then others. If you, or anyone else looking at this, is looking to contribute to these improvements please reach out and we can discuss the best way to go about this. Where we'll probably start by writing tests to make sure the changes we make don't break any functionality. |
I was running into the same issue today. |
Here the plugin is running all imports at the same time. |
Queueing would be nice. But setting up a proper queue system would be beyond the scope of this plugin. That being said, I would love to see a queue plugin for Strapi, implementing some open-source job runner server side. EDIT: Another solution we can explore is just wrapping the entire import method in a DB transaction. |
I'm not quite sure if we are talking about the same kind of queue here. I'm not talking about a separate service for background jobs. My idea is basically this:
The queue is just for chunking the work. |
I am setting up a VPS where multiple instances of strapi will be run. These instances connects to a DigitalOcean postgre managed database.
I started about the the lowest tier for the managed database (1GB of RAM) which gives me small amount of concurrent connections (22) something I just learnt. While this still in the PoC phase and the servers will be bigger I found it odd that with a handful of no traffic strapi instances I was quickly getting errors out of postgre when running
config-sync import
.I wondered by and while looking at database activity I saw that one run of
config-sync import
was creating several databases connections at the same time.I'd assume this is not needed and whatever this is doing it can be done using 1 (or as fewer as possible) connections or at least to have the option to limit it if this is because things are done in parallel.
Any advice/comment is appreciated.
The text was updated successfully, but these errors were encountered: