• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Best way to completely get rid of "statistics_collection"

gennolo

Basic Pleskian
Hello,
I am running several VMs in a datastore with Plesk 12.5.30 and I ran in disk IO/s trouble because of "statistics_collection" process reading like crazy domains files for hours and hours.
Domains have million of files and I don't really need internal statistics.

I followed this KB article :

http://talk.plesk.com/threads/disable-statistics_collector-on-all-domains.283647/

to disable statistics for all domains but I find that every night at midnight "statistics_collection" started again causing the same trouble.

I see that the script is called in /etc/cron.daily/50plesk-daily in this line:
/usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1

Is it safe to comment the line or there is another way to avoid statistics being generated ?

What does "DailyManteinance" script do other than creating statistics ?

Thank you.
 
DailyManteinance script makes a lot of different tasks - http://kb.odin.com/en/114797
So, it is very bad idea to disable this script.
As possible solution you can try to completely disable webstat calculation for particular domains with

# /usr/local/psa/bin/domain -u domain.com -webstat none

or for all domains with

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/domain -u $i -webstat none; done
 
Hello Igor ,
thank you for your quick response.

As I mentioned early, I already followed to KB article and I disabled webstat calculation for all domains (I also ran "httpdmng reconfigure all" after),
but I still encounter the problem of "statistics_collection" process running for hours every night on all VMs , dramatically increasing the load average because of I/O consumption.

VMs are quite large and they mostly run ecommerce websites (lot of small files, images, thumbnails, cache files etc.).

Those are the processes :

root 119545 0.0 0.0 106060 476 ? SN 03:43 0:00 \_ /bin/bash /usr/bin/run-parts /etc/cron.daily
root 119568 0.0 0.0 106060 472 ? SN 03:43 0:00 \_ /bin/sh /etc/cron.daily/50plesk-daily
root 119570 0.0 0.0 355784 852 ? SN 03:43 0:00 | \_ /usr/bin/sw-engine -c /usr/local/psa/admin/conf/php.ini /usr/local/psa/admin/plib/DailyMaintainance/script.php
root 128672 0.0 0.2 354500 4332 ? SN 04:19 0:00 | \_ /usr/bin/sw-engine -c /usr/local/psa/admin/conf/php.ini /usr/local/psa/admin/plib/DailyMaintainance/task-script.php ExecuteStatistics --period=daily
root 128677 0.0 0.2 362112 4804 ? SN 04:19 0:00 | \_ /usr/bin/sw-engine -c /usr/local/psa/admin/conf/php.ini /usr/local/psa/admin/sbin/statistics --no-webstat
root 128684 0.5 2.5 153488 48756 ? DN 04:19 1:22 | \_ /usr/local/psa/admin/bin/statistics_collector
root 119569 0.0 0.0 105948 396 ? SN 03:43 0:00 \_ awk -v progname=/etc/cron.daily/50plesk-daily progname {????? print progname ":\n"????? progname="";???? }???? { print; }

I have to kill the "statistics_collector" PID manually to get an accetable load on the VM.

So I would know how to avoid to run the "statistics_collection" process and leave the other manteinance tools.
 
There are not only webstatistics calculation but disk usage, traffic, etc which is performed by statistics_collection process. I'm afraid that it is hardcoded in DailyMaintainance script and this script started by crontask. So, it would be bad idea to disable whole DailyMaintainance script.
 
This is a screenshot of "iotop" running on a box where "statistics_collector" is running from 9 hours and counting.

So your only suggestion is to get a more performant disk ?
 

Attachments

  • 2015-11-23_0902.png
    2015-11-23_0902.png
    38.7 KB · Views: 11
I think that this problem is related to VPS resources allocation question. No easy and painless method for disabling statistics_collector completely. I'd suggest you contact your VPS and hardware node administrators regarding improving I/O performance for this overloaded VPS from hardware node side.
 
Indeed I solved the problem by distributing some of my VMs storage on another disk.
Thank you for your help.
 
Back
Top