Add a PHP Memory Readiness checker

Created on 17 July 2020, over 4 years ago
Updated 15 May 2023, over 1 year ago

When running In-Place updates, there is a high possibility the updates can fail because of the limited PHP memory. Thus if we can have a Readiness which checks for PHP memory.
We can consider a few factors like memory taken during Drupal Bootstrap & the amount of files that will be updating, etc.

Can we also think in terms of `max_execution_time` value?

Thoughts?

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

🇮🇳India JayKandari

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇹🇳Tunisia Ahmed Aziz ABBASSI

    @rivimey
    You make a good point about not needing to worry about bootstrap memory needs for a usable site. However, there are still many other factors that can affect memory usage during in-place updates, as you mentioned.

    I agree that memory profiling is a good approach to determine the factors that affect memory needs. By profiling the memory usage during different types of updates and configurations, we can identify the patterns and factors that contribute to higher memory usage.

    Regarding the memory limit check, checking if the memory_limit value is greater than a certain threshold is a good start. As you mentioned, a value like 200MB could be a reasonable threshold, but it may need to be adjusted based on the specific needs of the site.

    The second version you suggested, attempting to allocate blobs of memory until you run out, is not a good approach due to the potential problems it can cause on the host and in the PHP process. Instead, a more accurate approach would be to simulate the update process using a sample of the site's data and modules and measure the memory usage during the simulation. This would give us a more accurate estimate of the peak memory usage during an actual update.

    Overall, a combination of approaches, including memory profiling and simulation, can help us develop a more accurate and effective PHP memory readiness check for in-place updates.

  • @ahmed-aziz-abbassi opened merge request.
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    The probability of failure used to be high in Composer 1.

    In Composer 2, it's very low.

    Furthermore, it's impossible to know how much memory Composer will need. It depends on the complexity of the project.

    That's why I believe 📌 Add functional test that proves there is reasonable UX whenever a stage event subscriber has an exception Fixed is sufficient to handle this.

  • Assigned to Ahmed Aziz ABBASSI
  • Status changed to Needs work over 1 year ago
Production build 0.71.5 2024