Skip to content

Hitting memory limit of 128MB during staging #101

@ChristianRiesen

Description

@ChristianRiesen

I run a fairly large application with symfony 2. Now when deploying it fails in multiple colorful ways, though I got most of them licked by having the composer install done before the push and let CF take the entire vendor folder with it.

It still dies on one spot though. If I let the .bp-config/options.json file have this config for composer it fails:

  "COMPOSER_INSTALL_OPTIONS": [
    "--no-dev",
    "--no-interaction",
    "--prefer-dist"
  ]

But with this it works, though the cahce is not build and other things are not executed that are needed to make it run well:

  "COMPOSER_INSTALL_OPTIONS": [
    "--no-dev",
    "--no-interaction",
    "--no-scripts",
    "--prefer-dist"
  ]

It's clear to me that the limit comes from the php.ini file in the defaults folder. So I thought I'd be clever and supply my own. I copied the PHP 5.5 ini file (using PHP 55 latest) to .bp-config/php/php.ini and just up the memory limit.

That "worked" as in the limit was upped, but then weirdly it couldn't find the .so extensions anymore. It tried to load them (so adding the lines worked) but for some reason the files did not seem to be at the path they should be. I noticed that with the supplied php.ini it would not expand the @ marked values for HOME and so on, while it would on the BP internal one. I think there must be more going on beyond that since the extension files were not present either apparently.

I got the runtime php to up the limit by making a small ini in .bp-config/php/conf.d/project.ini with just the memory limit raising, then set the environment variable in the manifest:

  env:
    DOCUMENT_ROOT: web
    SYMFONY_ENV: prod
    PHP_INI_SCAN_DIR: /home/vcap/app/.bp-config/php/conf.d

That works with the droplet running, but still during staging, it doesn't.

So how do I raise the limit during staging (the composer install fails since running out of memory) and still have the extensions working?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions