A machine-readable guide to this site for AI agents and language models is available at/llms.txt(https://dev.acquia.com/llms.txt on the production site).
Clearing out expired fields in your databases - the untold wonders of Drupal Cron | Cloud Platform | Acquia Product Documentation
Cloud Platform
Clearing out expired fields in your databases - the untold wonders of Drupal Cron
Clearing out expired fields in your databases - the untold wonders of Drupal Cron
Date Published: August 16, 2023
Issue
A database table, such as the key_value_expire table, is filled with expired entries. Large tables with outdated information can cause maintenance and performance issues, and even service interruptions.
Resolution
The fix is to purge all of the entries which have an expire date that has already passed. Running your site's Drupal Cron regularly does this.
Looking at D.O's Cron automated tasks overview you will see that there are four bullet points regarding tasks that a properly configured cron job can manage:
Updates the index of site content used by the Search module.
Queues feeds to be updated by the Aggregator module.
Checks for available updates for the Update Manager module.
Performs routine maintenance tasks, such as removing older rows from logs, for the System module.
Looking deeper into core/modules/system/system.module, you can see:
function system_cron() {
// Clean up the flood.
\Drupal::flood()->garbageCollection();
foreach (Cache::getBins() as $cache_backend) {
$cache_backend->garbageCollection();
}
// Clean up the expirable key value database store.
if (\Drupal::service('keyvalue.expirable.database') instanceof KeyValueDatabaseExpirableFactory) {
\Drupal::service('keyvalue.expirable.database')->garbageCollection();
}