Unexpected Memory Exhaustion in PHP Scripts on Cleavr Deployments

Hello

I’ve been running PHP applications on Cleavr, and recently I’ve encountered an unexpected memory exhaustion issue. Scripts that used to run smoothly are now hitting the PHP memory limit, causing abrupt terminations. :innocent:

This issue has surfaced after several routine deployments, and it seems to affect both CLI scripts and web requests, regardless of the workload. :innocent:

After some initial debugging, I’ve ensured that the memory limit settings in php.ini are appropriately configured, and I’ve profiled my code for potential memory leaks. :upside_down_face:

Despite these measures, the problem persists, leading me to suspect that it might be related to how Cleavr’s environment handles resource allocation during deployments or subsequent caching mechanisms. Checked PHP - Cleavrmongodb guide related to this and found it quite informative.

Has anyone else faced similar issues on Cleavr? I’m looking for insights into potential configuration tweaks, best practices for memory management in PHP, or any server-specific settings on Cleavr that might be causing this. :thinking:

Any suggestions on how to effectively debug and mitigate this memory exhaustion issue would be greatly appreciated.

Thank you !! :slightly_smiling_face:

Hello @Veronica, welcome to the Cleavr forum!

For freeing up space, I’d recommend the following as a starting point:

  1. Schedule a clean disk space job in the Server Maintenance section - this will help remove old, tmp, unnecessary files from the system
  2. Tweak deployments to hold on to in the Deployment Workflow > Settings section, the default is to hold onto the last 5 deployments, but adjusting to 3 may likely suffice

If that doesn’t seem to free up enough space, then another thing I’d typically do is SSH into the server and run commands to see how much disk space each directory (and their subdirectories) is taking up and then narrowing in on bloat from there.