titanbird
titanbird

Reputation: 183

composer.phar very slow and not completing install or update

I must use composer on my own nas server for a php web project. Composer is available there on my nas, i downloaded the newest version, but if I call install or update, it need a long time and then composer does nothing anymore (no furthed progress, it stucks on "writing to cache" or "reading from cache").

Eatings for a few hours:

CPU: 0 - 19%
HDD: 70%!
RAM: 70 - 80%

... but no progress. Composer looks like he paused and do nothing. You will see the composer output logfile soon.

I would like to show you my composer.json:

    {
        "name": "symfony/framework-standard-edition",
        "license": "MIT",
        "type": "project",
        "description": "The \"Symfony Standard Edition\" distribution",
        "autoload": {
            "psr-0": { "": "src/" }
        },
        "require": {
            "php": ">=5.3.3",
            "symfony/symfony": "~2.4",
            "doctrine/orm": "~2.2,>=2.2.3",
            "doctrine/doctrine-bundle": "~1.2",
            "twig/extensions": "~1.0",
            "symfony/assetic-bundle": "~2.3",
            "symfony/swiftmailer-bundle": "~2.3",
            "symfony/monolog-bundle": "~2.4",
            "sensio/distribution-bundle": "~2.3",
            "sensio/framework-extra-bundle": "~3.0",
            "sensio/generator-bundle": "~2.3",
            "incenteev/composer-parameter-handler": "~2.0",
            "doctrine/doctrine-fixtures-bundle": "dev-master",
            "doctrine/data-fixtures" : "dev-master",
            "raveren/kint": "@dev",
            "cg/kint-bundle": "dev-master"
        },
        "scripts": {
            "post-install-cmd": [
                "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
            ],
            "post-update-cmd": [
                "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
            ]
        },
        "config": {
            "bin-dir": "bin"
        },
        "minimum-stability": "dev",
        "extra": {
            "symfony-app-dir": "app",
            "symfony-web-dir": "web",
            "incenteev-parameters": {
                "file": "app/config/parameters.yml"
            },
            "branch-alias": {
                "dev-master": "2.4-dev"
            }
        }
    }

Here's my call to start composer:

php composer.phar update --prefer-dist -vvv --profile >./composer.log.txt

He run a long time and after some "hours" (!!) i killed it with CTRL + C. It is no problem, if composer would need a long time, maybe some hours, but he should finish his work at least. I have to tell something about the nas. It is not powerful. 1.2 GHz, 128 MB RAM. So this could be a big problem for running composer?

xdebug is deactivated.

Here's the composer log output, composer.log.txt:

[0.9MB/0.11s] Reading ./composer.json
[0.9MB/0.20s] Loading config file ./composer.json
[0.9MB/0.30s] Executing command (CWD): git describe --exact-match --tags
[1.0MB/0.68s] Executing command (CWD): git branch --no-color --no-abbrev -v
[1.6MB/1.41s] Loading composer repositories with package information
[1.7MB/1.50s] Downloading https://packagist.org/packages.json
[1.7MB/1.71s] Writing /root/.composer/cache/repo/https---packagist.org/packages.json into cache
[1.7MB/1.78s] Updating dependencies (including require-dev)
[1.7MB/1.83s] Reading /root/.composer/cache/repo/https---packagist.org/p-provider-active.json from cache
[4.1MB/2.14s] Reading /root/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
[9.2MB/2.78s] Downloading https://packagist.org/p/provider-latest$27f0883b66e23851d98d77f3f2d38b260f97886ecaef58ba5270dc855617f31d.json
[13.9MB/3.66s] Writing /root/.composer/cache/repo/https---packagist.org/p-provider-latest.json into cache
[12.6MB/3.95s] Downloading https://packagist.org/p/provider-stale$8f6a69f2604637ea5a49e850799189ce535eef932daa4cd3a975876dfde82ece.json
[16.6MB/4.78s] Writing /root/.composer/cache/repo/https---packagist.org/p-provider-stale.json into cache
[15.1MB/5.18s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$data-fixtures.json from cache
[15.1MB/5.24s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$doctrine-fixtures-bundle.json from cache
[15.2MB/5.38s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jdorn$sql-formatter.json from cache
[15.2MB/5.41s] Reading /root/.composer/cache/repo/https---packagist.org/provider-psr$log.json from cache
[15.2MB/5.43s] Reading /root/.composer/cache/repo/https---packagist.org/provider-twig$twig.json from cache
[15.4MB/5.55s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$lexer.json from cache
[15.5MB/5.56s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$annotations.json from cache
[15.5MB/5.59s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$collections.json from cache
[15.5MB/5.61s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$cache.json from cache
[15.6MB/5.64s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$inflector.json from cache
[15.6MB/5.66s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$common.json from cache
[15.9MB/5.86s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$dbal.json from cache
[16.4MB/6.42s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$doctrine-bridge.json from cache
[23.3MB/13.20s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$framework-bundle.json from cache
[24.9MB/14.40s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$doctrine-bundle.json from cache
[25.1MB/14.65s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$config.json from cache
[25.5MB/15.39s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$http-kernel.json from cache
[27.9MB/16.32s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$filesystem.json from cache
[28.3MB/16.68s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$routing.json from cache
[29.0MB/17.45s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$stopwatch.json from cache
[29.3MB/17.73s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$translation.json from cache
[29.8MB/18.24s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$dependency-injection.json from cache
[30.4MB/18.83s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$event-dispatcher.json from cache
[31.0MB/19.70s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$templating.json from cache
[31.5MB/20.71s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$http-foundation.json from cache
[31.9MB/21.23s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-core.json from cache
[32.6MB/21.92s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-csrf.json from cache
[33.5MB/23.54s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$debug.json from cache
[33.2MB/26.25s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$doctrine-cache-bundle.json from cache
[33.3MB/26.36s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security.json from cache
[34.2MB/28.09s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$process.json from cache
[34.6MB/28.49s] Reading /root/.composer/cache/repo/https---packagist.org/provider-kriswallsmith$assetic.json from cache
[34.9MB/28.84s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$options-resolver.json from cache
[35.2MB/29.16s] Reading /root/.composer/cache/repo/https---packagist.org/provider-knplabs$gaufrette.json from cache
[35.4MB/29.46s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$finder.json from cache
[35.8MB/30.25s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$assetic-bundle.json from cache
[36.5MB/36.41s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$console.json from cache
[37.0MB/36.86s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$orm.json from cache
[37.7MB/37.56s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$instantiator.json from cache
[37.7MB/37.63s] Reading /root/.composer/cache/repo/https---packagist.org/provider-twig$extensions.json from cache
[37.8MB/37.67s] Reading /root/.composer/cache/repo/https---packagist.org/provider-swiftmailer$swiftmailer.json from cache
[37.9MB/37.76s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$swiftmailer-bridge.json from cache
[38.4MB/38.22s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$swiftmailer-bundle.json from cache
[38.8MB/38.72s] Reading /root/.composer/cache/repo/https---packagist.org/provider-sensio$distribution-bundle.json from cache
[39.1MB/39.19s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$class-loader.json from cache
[39.6MB/39.66s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$form.json from cache
[40.5MB/40.43s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$validator.json from cache
[41.4MB/41.43s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$yaml.json from cache
[42.9MB/42.52s] Reading /root/.composer/cache/repo/https---packagist.org/provider-sensiolabs$security-checker.json from cache
[42.9MB/42.69s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$property-access.json from cache
[43.2MB/42.96s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$locale.json from cache
[43.7MB/43.77s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$intl.json from cache
[44.6MB/44.70s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$icu.json from cache
[44.2MB/45.34s] Reading /root/.composer/cache/repo/https---packagist.org/provider-sensio$generator-bundle.json from cache
[44.6MB/45.93s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$doctrine-bundle.json from cache
[44.6MB/46.20s] Reading /root/.composer/cache/repo/https---packagist.org/provider-incenteev$composer-parameter-handler.json from cache
[44.6MB/46.39s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$symfony.json from cache
[44.7MB/46.55s] Reading /root/.composer/cache/repo/https---packagist.org/provider-monolog$monolog.json from cache
[44.9MB/47.06s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$monolog-bridge.json from cache
[45.5MB/47.61s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$monolog-bundle.json from cache
[45.9MB/48.94s] Reading /root/.composer/cache/repo/https---packagist.org/provider-sensio$framework-extra-bundle.json from cache
[46.2MB/49.30s] Reading /root/.composer/cache/repo/https---packagist.org/provider-raveren$kint.json from cache
[46.3MB/49.32s] Reading /root/.composer/cache/repo/https---packagist.org/provider-cg$kint-bundle.json from cache
[46.3MB/49.34s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$framework-standard-edition.json from cache
[49.3MB/50.39s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$security-extra-bundle.json from cache
[49.4MB/50.49s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$di-extra-bundle.json from cache
[49.6MB/50.67s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-bundle.json from cache
[50.3MB/51.34s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$metadata.json from cache
[50.4MB/51.39s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$aop-bundle.json from cache
[50.5MB/52.92s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$cg.json from cache
[50.5MB/53.17s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$parser-lib.json from cache
[50.5MB/53.25s] Reading /root/.composer/cache/repo/https---packagist.org/provider-phpoption$phpoption.json from cache
[56.5MB/58.98s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$browser-kit.json from cache
[57.2MB/62.36s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$css-selector.json from cache
[57.6MB/63.24s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$dom-crawler.json from cache
[58.1MB/64.05s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$propel1-bridge.json from cache
[58.6MB/64.73s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$serializer.json from cache
[59.0MB/67.62s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$twig-bridge.json from cache
[60.1MB/68.66s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$twig-bundle.json from cache
[60.7MB/69.85s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$web-profiler-bundle.json from cache
[61.6MB/73.41s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$proxy-manager-bridge.json from cache
[61.9MB/74.49s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$expression-language.json from cache
[62.0MB/75.01s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-acl.json from cache
[62.3MB/87.77s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-http.json from cache
[86.6MB/299.81s] Downloading http://packagist.org/p/symfony/doctrine-abstract-bundle$557a1f9a31777860331e98ff2877ea8d8caf0d14519abf3d20cba65cf3ad4fc0.json
[87.1MB/300.38s] Writing /root/.composer/cache/repo/https---packagist.org/provider-symfony$doctrine-abstract-bundle.json into cache

No further progress at "Writing /root/.composer/cache/repo/https---packagist.org/provider-symfony$doctrine-abstract-bundle.json into cache" for 7 hours. But the HDD was working a lot.

I tried again for a very long time and then composer stucked on "Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$doctrine-abstract-bundle.json from cache".

Do you know what to do to fix this? I would be glad about every advice. Thank you.

Upvotes: 2

Views: 3095

Answers (1)

Sven
Sven

Reputation: 70863

After reviewing your hardware details, the situation is clear: 128 MB of RAM is not enough!

I have seen reports for Composer using as much as 4 GB in more extreme cases, and easily up to 1 GB regularly. Your NAS probably is busy swapping and will eventually finish given enough time, but this will probably take days if not weeks.

Don't run Composer on underpowered hardware. Try to run it on a machine that is able to give plenty of RAM. Then grab all the files downloaded and put them on your NAS to run the application.

Additionally, you make things worse by running an update, and with "minimum-stability:dev". Running the update forces Composer to download plenty of package info about all possible versions that it might be updating to. Running with dev stability increases the amount of versions considerably.

I think that Composer MIGHT be able to simply run install (it will require less RAM because it simply has to download all the packages mentioned in the composer.lock), but 128 MB is probably way too low to succeed.

Upvotes: 3

Related Questions