V
V
VisualIdeas2020-07-04 21:25:54
PHP
VisualIdeas, 2020-07-04 21:25:54

Why can Composer slow down?

We have a simple composer.json file :

{
  "name": "vendor_name/package_name",
  "description": "description_text",
  "minimum-stability": "stable",
  "license": "proprietary",
  "authors": [
    {
      "name": "author's name",
      "email": "[email protected]"
    }
  ],
  "require": {
    "colshrapnel/safemysql": "1.0.0",
    "codedungeon/php-cli-colors": "1.11.0",
    "psr/log": "1.1.3",
    "ext-mbstring": "*",
    "jbroadway/urlify": "1.0.0-stable",
    "box/spout": "3.1.x-dev"
  }
}


Run composer update
Messages appear:
Loading composer repositories with package information
Updating dependencies (including require-dev)


And then it hangs for 30-40 minutes
. The same thing happens when you add one package!

After 30-40 minutes everything goes fine...
Package operations: 6 installs, 0 updates, 0 removals
  - Installing colshrapnel/safemysql (1.0.0): Loading from cache
  - Installing codedungeon/php-cli-colors (1.11.0): Loading from cache
  - Installing psr/log (1.1.3): Loading from cache
  - Installing jbroadway/urlify (1.0.0-stable): Loading from cache
  - Installing box/spout (dev-master ab973ca): Cloning ab973cab34 from cache
box/spout suggests installing ext-intl (To handle non UTF-8 CSV files (if "iconv" is not already installed))
Writing lock file
Generating autoload files


Cleared the composer clearcache and tried again:
Same story....((( Only the result message is slightly different:
Package operations: 6 installs, 0 updates, 0 removals
  - Installing colshrapnel/safemysql (1.0.0): Downloading (100%)         
  - Installing codedungeon/php-cli-colors (1.11.0): Downloading (100%)         
  - Installing psr/log (1.1.3): Downloading (100%)         
  - Installing jbroadway/urlify (1.0.0-stable): Downloading (100%)         
  - Installing box/spout (dev-master ab973ca): Cloning ab973cab34 from cache
box/spout suggests installing ext-intl (To handle non UTF-8 CSV files (if "iconv" is not already installed))
Writing lock file
Generating autoload files


For the sake of experiment, I tried it on a system SSD NVME disk - the story is 100% the same (so it's not the HDD).

MacOS High Sierra (10.13.6 (17G13035))
Composer version 1.10.7 2020-06-03 10:03:56


UPD: Assumed many dependencies - left 1 package
https://github.com/php-fig/log ( there are no dependencies and the package itself is literally a couple of files)
History repeats itself

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Davydov, 2020-07-04
@VisualIdeas

Try to move composer globally, because when synchronized, it can write the cache to the NFS directory.
Making the composer globally solves the problem by starting to write the cache not to the NFS directory, but globally.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question