Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Faster composer install

A composer install normally takes a few minutes. And on a production environment it's feels too slow. Is it possible to make a composer install to a temp directory and then switch it? If that is possible the downtime should be about zero.

Or are there any other way to do a composer install faster?

like image 827
brasimon Avatar asked Dec 29 '13 16:12

brasimon


People also ask

How can I make my composer faster?

Always composer update on your dev machine first, test it and if all test are valid deploy the composer. lock to your production environment and run composer install there. Now composer installes exactly the versions you tested before, even if there are newer (but untested) ones.

How can I speed up my composer update?

Go nuclear. Clear your cache, remove the vendor directory and lockfile, and do a composer update.

Should I install composer as root?

For this reason, it is strongly advised to avoid running Composer as super-user/root. All commands also dispatch events which can be caught by plugins so unless explicitly disabled installed plugins will be loaded/executed by every Composer command.

How do I upgrade composer to 2.0 in Linux?

For updating your Composer, you need to open the terminal (if you have a global installation) and run one of the following commands: Use composer self-update --preview to try the latest RC version (2. x). Use composer self-update --snapshot to try the latest dev build (2.


1 Answers

I created a composer plugin to download packages in parallel.
https://packagist.org/packages/hirak/prestissimo

$ composer global require hirak/prestissimo

Please try it. In my environment, composer install become 10 times faster.

like image 82
hiraku Avatar answered Nov 02 '22 21:11

hiraku