wordpress-playground icon indicating copy to clipboard operation
wordpress-playground copied to clipboard

PHP: Reduce memory requirements – lower the HEAP size from 1GB

Open adamziel opened this issue 10 months ago • 0 comments

PHP is currently compiled to allocate 1024M of memory when it boots, and it limits the number of Playgrounds you can run concurrently especially on low-resource devices:

https://github.com/WordPress/wordpress-playground/blob/6668457e2e5050ec2815a21646b940ab52b32d8f/packages/php-wasm/compile/php/Dockerfile#L870

Let's see how low can we go while still keeping 256M available for running requests.

Importantly, MEMFS files are also kept at heap. I wonder what else is.

Resources

Discussions related to measuring memory usage

  • https://github.com/WordPress/wordpress-playground/wiki/Performance-testing-resources
  • https://github.com/WordPress/wordpress-playground/issues/69

Related to

  • https://github.com/WordPress/wordpress-playground/issues/1128
  • https://github.com/WordPress/wordpress-playground/pull/1232

@brandonpayton @ellatrix

adamziel avatar Apr 12 '24 09:04 adamziel