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

Handle large number of files #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

virmundi
Copy link

Large numbers of migrations lead to a message like

unable to retrieve applied migrations: unable to open file referencedata/sql/1650930505164-eq_rates_latlong_2decimals_v2-eq_rates_latlong_2decimals-219.sql: open referencedata/sql/1650930505164-eq_rates_latlong_2decimals_v2-eq_rates_latlong_2decimals-219.sql: too many open files

Our project has 6249 migrations. This fix allows such projects to work by limiting the number of active file descriptors opened. I was able to successfully run the apply operation on the 6249 without issue.

The patch reduces the performance on large runs (sample size my project) by approximately 27%. The average duration to run the migrations with the patch is 249 seconds. The average duration to run the present release of elwinar/rambler is 194 seconds, but can't be run a second time due to file descriptor exhaustion.

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

Successfully merging this pull request may close these issues.

2 participants