cakephp / cakephp/phinx

Run Phinx migrations parallel on multiple database exhaust the CPU

Open
#2,149 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.