When things take longer than you thought: Moving workloads to background processes
Your Drupal site needs to assign automatically a taxonomy term to some nodes at creation time. This sounds like a simple task that can be achieved with a hook or event subscriber.
Suddenly, editors experience the dreaded White Screen of Dead or random timeout messages when creating new terms that attempt to update thousands of nodes. Even worse: the process is not completed so you need to audit the whole site to sort the content out.
When these automatic tasks are complex or imply a big number of entities that need to be updated, the risk to run out of time or resources increases. Under these circumstances it is better to use background processes.
Drupal provides batches, cron & queues. These tools help execute heavy tasks in a separate process where timeouts and memory consumption can be controlled and errors can be handled. We will explore these tools, and look at examples on how to deal with simple tasks or complex ones depending on the needs.
Developers who manage large sites that need to be updated based on different triggers will take advantage of the various approaches and strategies explained.
This session will help you to identify possible bottlenecks in your Drupal projects and how to tackle them by moving tasks to the background.
Suddenly, editors experience the dreaded White Screen of Dead or random timeout messages when creating new terms that attempt to update thousands of nodes. Even worse: the process is not completed so you need to audit the whole site to sort the content out.
When these automatic tasks are complex or imply a big number of entities that need to be updated, the risk to run out of time or resources increases. Under these circumstances it is better to use background processes.
Drupal provides batches, cron & queues. These tools help execute heavy tasks in a separate process where timeouts and memory consumption can be controlled and errors can be handled. We will explore these tools, and look at examples on how to deal with simple tasks or complex ones depending on the needs.
Developers who manage large sites that need to be updated based on different triggers will take advantage of the various approaches and strategies explained.
This session will help you to identify possible bottlenecks in your Drupal projects and how to tackle them by moving tasks to the background.