Run Phinx migrations parallel on multiple database exhaust the CPU
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
- While running phinx migration on multiple databases always exhaust the database CPU
Use Case
1 database has 17 migrations to execute and there are total of 500 database, I am running 20 in PARALLEL but it always throw below error after executing few.
PDOException: SQLSTATE[HY000] [2002] Connection refused in /composer/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:83 Stack trace: #0 /composer/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(83): PDO->__construct('mysql:host=127....', 'dbuser', 'dbpassword', Array)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at composer/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:83 and reproduce the reported setup: 20 migrations running in parallel across 500 MySQL databases. Inspect how connections are created and how the connection-refused error relates to database CPU exhaustion. Done should include a clearly identified cause and verified behavior under the reported parallel workload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100