email disk usage cache to speed up the pop page

Version 1.27

Feature
Finished

implement a pop email disk usage caching option (disabled by default) such that the pop emails page can have several thousand or more emails, and the disk usage calculations won't slow things down. To enable this feature, add the following to your directadmin.conf. pop_disk_usage_cache=1 Once added, restart DA. Initially, no cache files will exist. A user will view his pop page, all pop accounts disk usage will show 0. DA will notice there is no cache file (/etc/virtual/domain.com/usage.cache) and add it's creation to the task.queue to be created within one minute. If the usage.cache does exist but is more than 10 minutes old, again, DA will issue an update to this file to the task.queue to be updated within one minute. There are other means to update the usage.cache files on a regular basis. This can be done by creating cron jobs. The 2 commands you can use are: echo "action=cache&type=popquota" >> /usr/local/directadmin/data/task.queue echo "action=cache&type=popquota&value=domain.com" >> /usr/local/directadmin/data/task.queue Without the "value=domain.com", all domains will be updated. With value=domain.com, only that domain is updated. You can add it to the /etc/cron.d/directadmin_cron (or /etc/crontab on freebsd) by adding the line: */15 * * * * root echo "action=cache&type=popquota" >> /usr/local/directadmin/data/task.queue to the respective file, then restart crond. This will update everyones pop disk usage cache every 15 minutes. Note that the cronjobs are not required due to the intelligent way DA checks the usage.cache file, but I would still recommend adding some sort of update interval (at least daily) so that your users are not confused why their pop account stats are 0 for 1 minute, then full the next (due to the task.queue cron delay) The current known upper limit is roughly 32,000 emails. The only restriction is the file system limit on the number of directories it can have in once place. If you were to increase this limit and recompile your kernel you can greatly increase the number of potential email accounts per domain to a very high number.

Interested to try DirectAdmin? Get a 30-day Free Trial!