Open pdewouters opened 8 years ago
Ultimately this is because the machine itself is running out of memory. There's no way to fix this from within the PHP script other than generally trying to reduce our memory usage.
side note it would be useful to profile our memory usage to make sure it's at least sane.
Looking at some other projects:
Composer solved by adding a troubleshooting doc to cover that error: https://github.com/composer/composer/pull/2748
Varying Vagrant Vagrants specifically upped their memory usage in response to this. Salty WordPress also runs with 1024MB
of memory.
Some possible actions here:
ZipArchive
anyway.I don't think 3 is useful, in practise very few people can control the amount of memory their server has. Also this is often just a transient issue as it depends on the system memory already being low (assuming we're not using that much memory ourselves).
I vote we do some profiling to check we're not being a bad citizen when it comes to memory usage and then silence this error and quietly fallback to ZipArchive
.
Yeah, I thought so. I was running another resource intensive process. One thing we could do is make sure we don't run several backups at the same time.
One thing we could do is make sure we don't run several backups at the same time.
Yeah definitely. We already default to setting the default schedules to different time. Perhaps we could make it clearer when someone is creating a new schedule that one of their existing schedules is already running at the time they've specified.
I ran some testing in low memory environments and was successfully able to complete a backup even with a memory_limit = 16MB
. We don't have a memory problem.
Given we'll just fallback to ZipArchive
whenever this happens I'm going to close.
Since https://github.com/humanmade/backupwordpress/commit/b2532e1fb464a42a313262396b399c1ef6232577 we no longer surface errors from failed backup engines if a subsequent engine succeeds so this error won't even show any more.
@pdewouters Just realised I accidentally committed https://github.com/humanmade/backupwordpress/commit/b2532e1fb464a42a313262396b399c1ef6232577 directly to master, fancy giving it a quick post-review :-)
just had this pop up on my local on master
We shouldn't be seeing this error anymore since https://github.com/humanmade/backupwordpress/commit/b2532e1fb464a42a313262396b399c1ef6232577
I'm seeing this again when trying to run phpunit
without any groups or limitations in place. It always runs out at exactly the same spot, so it's also plausible something in the WordPress tests can be further optimized.
https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors This could be happening because the VPS runs out of memory and has no Swap space enabled.
free -m
total used free shared buffers cached
Mem: 2048 357 1690 0 0 237
-/+ buffers/cache: 119 1928
Swap: 0 0 0
To enable the swap you can use for example:
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
then update composer
Similar to https://github.com/humanmade/backupwordpress/issues/997 ?