Is it possible to automate this cleanup from within MailWizz? I'd prefer not to write my own script that directly modifies the database table.Those are kept only to calculate the servers sending quota and customers sending quota.
However, you can always delete records older than a month for example.
Done, thanks!Of course, open apps/console/commands/DailyCommand.php and have a look inside, it'll make sense how you can change it.
I think I'll keep it as is right now... I was just trying to save space, the speed of the table itself is not an issue at the moment.If you delete from campaign_delivery_log, then stats for the old campaigns will be affected and i am not sure you want that, and if you'd want that you might as well delete the campaigns.
There's a feature in mailwizz, that hasn't been tested that much, but that allws you to move logs from campaign_delivery_log into another table, in campaign_delivery_log_archive so that you keep your original table as slim as possible.
The file that does this is apps/console/commands/ArchiveCampaignsDeliveryLogsCommand.php and can be triggered from command line with: php -q /absolutre/path/to/apps/console/console.php archive-campaigns-delivery-logs
However, you'll want to go through that file first because it tried to do some heavy lifting and you need to make sure your server can handle this. There's no guarantee for it to work.
Thanks.
return array(
'MW_PERF_LVL_DISABLE_DS_LOG_USAGE' => 2, // disable delivery server log usage
'MW_PERF_LVL_DISABLE_CUSTOMER_QUOTA_CHECK' => 4, // disable customer quota check
'MW_PERF_LVL_DISABLE_DS_QUOTA_CHECK' => 8, // disable delivery server quota check
'MW_PERF_LVL_DISABLE_DS_CAN_SEND_TO_DOMAIN_OF_CHECK' => 16, // disable checking if can send to domain of the email address
'MW_PERF_LVL_DISABLE_SUBSCRIBER_BLACKLIST_CHECK' => 32, // disable checking emails against blacklist
);
if (!defined('MW_PERF_LVL')) {
define('MW_PERF_LVL', MW_PERF_LVL_DISABLE_DS_LOG_USAGE | MW_PERF_LVL_DISABLE_CUSTOMER_QUOTA_CHECK);
}
If it helps, i have just added some perfomance flags that one, depending on how he uses mailwizz, can use.
These are the flags:
So, if one doesn't want to log delivery servers sending and don't want to check customer quota (these two are expensive operations) could create a file called performance-levels-custom.php in apps/common/config and inside it define the MW_PERF_LVL constant as :PHP:return array( 'MW_PERF_LVL_DISABLE_DS_LOG_USAGE' => 2, // disable delivery server log usage 'MW_PERF_LVL_DISABLE_CUSTOMER_QUOTA_CHECK' => 4, // disable customer quota check 'MW_PERF_LVL_DISABLE_DS_QUOTA_CHECK' => 8, // disable delivery server quota check 'MW_PERF_LVL_DISABLE_DS_CAN_SEND_TO_DOMAIN_OF_CHECK' => 16, // disable checking if can send to domain of the email address 'MW_PERF_LVL_DISABLE_SUBSCRIBER_BLACKLIST_CHECK' => 32, // disable checking emails against blacklist );
PHP:if (!defined('MW_PERF_LVL')) { define('MW_PERF_LVL', MW_PERF_LVL_DISABLE_DS_LOG_USAGE | MW_PERF_LVL_DISABLE_CUSTOMER_QUOTA_CHECK); }
Thanks!@Lakjin - Yes.
Yep, that answered it. Thanks. Hopefully this will fix the slowness issues.@Lakjin - No, the stats should be there, mailwizz will read from both tables if you start archiving stuff, if i got your question right...
Yeah, I've been thinking about doing that. Will let you know how it goes.@Lakjin - Good to know that command is reliable
I think you can shove it in a cron at midnight and keep everything clean this way.