Composer: Composer is really slow

Created on 23 May 2017  ·  3Comments  ·  Source: composer/composer

Today a composer install command takes many time to finish. It happens both global and local requires.

The composer diagnose is everything ok.

When I run this command (but it's the same with a local installer):

$ composer global require  hirak/prestissimo --profile -vvv

I get the following output:

[1.4MB/0.00s] Changed current directory to /home/vagrant/.config/composer
Failed to initialize global composer: Composer could not find the config file: /home/vagrant/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Running 1.4.2 (2017-05-17 08:17:52) with PHP 7.1.5-1+deb.sury.org~xenial+2 on Linux / 4.4.0-31-generic
[1.7MB/0.01s] Reading ./composer.json
[1.7MB/0.01s] Loading config file ./composer.json
[2.0MB/0.01s] Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
[1.9MB/0.02s] Executing command (/home/vagrant/.config/composer): git branch --no-color --no-abbrev -v
[1.9MB/0.03s] Executing command (/home/vagrant/.config/composer): git describe --exact-match --tags
[1.9MB/0.03s] Executing command (/home/vagrant/.config/composer): git log --pretty="%H" -n1 HEAD
[1.9MB/0.04s] Executing command (/home/vagrant/.config/composer): hg branch
[1.9MB/0.04s] Executing command (/home/vagrant/.config/composer): fossil branch list
[1.9MB/0.04s] Executing command (/home/vagrant/.config/composer): fossil tag list
[1.9MB/0.05s] Executing command (/home/vagrant/.config/composer): svn info --xml
[2.4MB/0.09s] Downloading https://packagist.org/packages.json
[2.4MB/7.84s] Writing /home/vagrant/.cache/composer/repo/https---packagist.org/packages.json into cache
[2.4MB/7.84s] Downloading http://packagist.org/p/provider-2013%24442e1d5fa0fdbf77855cc363b024994a3e92a2f5099e5138b9c5777ae486703c.json
[2.5MB/108.65s] Downloading http://packagist.org/p/provider-2013%24442e1d5fa0fdbf77855cc363b024994a3e92a2f5099e5138b9c5777ae486703c.json

It blocks in the last row, but it's very random, because if I leave it for ~30 minutes it continues to fetch other URIs, but it stops randomly to other URIs and it takes more than 30 minutes sometimes.

Any idea why is it happening? It seems for only my computer (both vagrant and local machine), but if I try with another machine it works normally. What can I check?

Most helpful comment

Please follow https://github.com/composer/composer/issues/6342 for the current issue

All 3 comments

I'm getting

Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info

with travis builds

Please follow https://github.com/composer/composer/issues/6342 for the current issue

Anyway, after a complete restart of my laptop, it was fixed! I don't know why, but it's ok for me now. I'll follow the other issue though, thanks.

Was this page helpful?
0 / 5 - 0 ratings