On our webshop (running community 2.1.9) we have a table called reporting_system_updates and it is allready over 300Mb in size. Can I safely truncate this table?
1 Answer
(TLDR) Simple/Short Answer:
Here's a screenshot of the "Official" response I received - from the New Relic Support team:
In other words, you can safely delete data in the reporting_system_updates
table using either of the following SQLs:
// The "I'm All In" Approach
truncate table reporting_system_updates ;
// The "Play It Safe(r)" Approach
delete from reporting_system_updates where type in ( 'moduleEnabled' , 'moduleInstalled' , 'moduleUninstalled' ) ;
(Much) Longer Answer:
Looking at the New Relic cron (vendor/magento/module-new-relic-reporting/etc/crontab.xml) which is currently scheduled to run every 2 minutes:
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="default">
<job name="magento_newrelicreporting_cron" instance="Magento\NewRelicReporting\Model\Cron" method="runCron">
<schedule>*/2 * * * *</schedule>
</job>
</group>
</config>
The cron invokes the following runCron()
method within vendor/magento/module-new-relic-reporting/Model/Cron.php
Code of interest in the above snippet is:
$this->reportModulesInfo->report();
Which takes us to vendor/magento/module-new-relic-reporting/Model/Cron/ReportModulesInfo.php
Code of interest in the above snippet is:
$moduleData = $this->collect->getModuleData();
Which takes us to vendor/magento/module-new-relic-reporting/Model/Module/Collect.php
Code of interest in the above snippet is:
$configModules = $this->getAllModules();
Which takes us to vendor/magento/module-new-relic-reporting/Model/Module/Collect.php
Code of interest in the above snippet is:
return $this->fullModuleList->getAll();
Which takes us to vendor/magento/framework/Module/FullModuleList.php
Code of interest in the above snippet is:
$this->data = $this->loader->load();
Which takes us to vendor/magento/framework/Module/ModuleList/Loader.php
Once all the requisite Module Information is sourced in vendor/magento/module-new-relic-reporting/Model/Cron/ReportModulesInfo.php
the processor stores that module data in the DB tablereporting_system_updates
/** @var \Magento\NewRelicReporting\Model\System $systemModel */
$systemModel = $this->systemFactory->create();
$systemModel->setData($modelData);
$systemModel->save();
Your Typical Magento Installation has ~ 150 - 300 modules installed.
The New Relic cron is setup to be run every 2 minutes:
In other words, the reporting_system_updates
table will see ~150 - 300 new DB rows inserted into it every 2 minutes ... Extrapolate that and you're looking at roughly ~110K - 220K junk records / day.
-
You are my hero. Bravo sir! This helped me solve a really big WTF almost instantly. Commented Aug 28, 2019 at 18:07
-