Issue AWStats high CPU in localhost.localdomain

ic3_2k

New Pleskian
Server operating system version
AlmaLinux 8.10
Plesk version and microupdate number
Plesk Obsidian 18.0.73.4
Hello,

I'm facing a problem tat I don't know how to solve, my plesk is accessed via the ip name given by the host provider something like ns31234568.ip-37-172-26.com, locigally this name is not in the list of domains.
The problem is that the CPU goest 100% when awstats upates his data, creating several proceses like this:

Bash:
/usr/bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -update -config=ns31234568.ip-37-172-26.com -configdir=/etc/awstats
/usr/bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -update -config=localhost.localdomain -configdir=/etc/awstats

Bur when I try to disable it fails, as there is no confgured localhost.localdomain or ns.....


Bash:
~ plesk bin domain --update localhost.localdomain -webstat none
Unable to find domain with name 'localhost.localdomain'
exit status 4
 
Hello, @ic3_2k . Could you please try manually killing those processes:

Code:
ps auxf | grep awstats.pl
kill PID

If the issue reoccurs next time the Awstats process runs, please provide us with the content of /etc/awstats/awstats.model.conf
 
when I kill the processes seems like they automatically restarts again...

Now that you pointed me to this file, I can suppose that I have to add 'localhost.localdomain' to the SkipHosts parameter, isn't? As this is a system file do you know if the file will keep the changes even after a system update/upgrade


Code:
LogFile="/var/log/httpd/access_log"
LogType=W
LogFormat=1
LogSeparator=" "
SiteDomain="localhost.localdomain"
HostAliases="localhost 127.0.0.1"
DNSLookup=2
DynamicDNSLookup=0
DirData="/var/lib/awstats"
DirCgi="/awstats"
DirIcons="/awstats-icon"
AllowToUpdateStatsFromBrowser=0
AllowFullYearView=2
EnableLockForUpdate=1
DNSStaticCacheFile="dnscache.txt"
DNSLastUpdateCacheFile="dnscachelastupdate.txt"
SkipDNSLookupFor=""
AllowAccessFromWebToAuthenticatedUsersOnly=0
AllowAccessFromWebToFollowingAuthenticatedUsers=""
AllowAccessFromWebToFollowingIPAddresses=""
CreateDirDataIfNotExists=0
BuildHistoryFormat=text
BuildReportFormat=html
SaveDatabaseFilesWithPermissionsForEveryone=0
PurgeLogFile=0
ArchiveLogRecords=0
KeepBackupOfHistoricFiles=0
DefaultFile="index.php index.html"
SkipHosts="127.0.0.1"
SkipUserAgents=""
SkipFiles=""
SkipReferrersBlackList=""
OnlyHosts=""
OnlyUserAgents=""
OnlyUsers=""
OnlyFiles=""
NotPageList="css js class gif jpg jpeg png bmp ico rss xml swf eot woff woff2"
ValidHTTPCodes="200 304"
ValidSMTPCodes="1 250"
TrapInfosForHTTPErrorCodes = "400 403 404"
AuthenticatedUsersNotCaseSensitive=0
URLNotCaseSensitive=0
URLWithAnchor=0
URLQuerySeparators="?;"
URLWithQuery=0
URLWithQueryWithOnlyFollowingParameters=""
URLWithQueryWithoutFollowingParameters=""
URLReferrerWithQuery=0
WarningMessages=1
ErrorMessages=""
DebugMessages=0
NbOfLinesForCorruptedLog=50
WrapperScript=""
DecodeUA=0
MiscTrackerUrl="/js/awstats_misc_tracker.js"
LevelForBrowsersDetection=2         # 0 disables Browsers detection.
                                    # 2 reduces AWStats speed by 2%
                                    # allphones reduces AWStats speed by 5%
LevelForOSDetection=2               # 0 disables OS detection.
                                    # 2 reduces AWStats speed by 3%
LevelForRefererAnalyze=2            # 0 disables Origin detection.
                                    # 2 reduces AWStats speed by 14%
LevelForRobotsDetection=2           # 0 disables Robots detection.
                                    # 2 reduces AWStats speed by 2.5%
LevelForSearchEnginesDetection=2    # 0 disables Search engines detection.
                                    # 2 reduces AWStats speed by 9%
LevelForKeywordsDetection=2         # 0 disables Keyphrases/Keywords detection.
                                    # 2 reduces AWStats speed by 1%
LevelForFileTypesDetection=2        # 0 disables File types detection.
                                    # 2 reduces AWStats speed by 1%
LevelForWormsDetection=0            # 0 disables Worms detection.
                                    # 2 reduces AWStats speed by 15%
UseFramesWhenCGI=1
DetailedReportsOnNewWindows=1
Expires=3600
MaxRowsInHTMLOutput=10000
Lang="auto"
DirLang="./lang"
ShowMenu=1
ShowSummary=UVPHB
ShowMonthStats=UVPHB
ShowDaysOfMonthStats=VPHB
ShowDaysOfWeekStats=PHB
ShowHoursStats=PHB
ShowDomainsStats=PHB
ShowHostsStats=PHBL
ShowAuthenticatedUsers=0
ShowRobotsStats=HBL
ShowWormsStats=0
ShowEMailSenders=0
ShowEMailReceivers=0
ShowSessionsStats=1
ShowPagesStats=PBEX
ShowFileTypesStats=HB
ShowFileSizesStats=0
ShowDownloadsStats=HB
ShowOSStats=1
ShowBrowsersStats=1
ShowScreenSizeStats=0
ShowOriginStats=PH
ShowKeyphrasesStats=1
ShowKeywordsStats=1
ShowMiscStats=a
ShowHTTPErrorsStats=1
ShowHTTPErrorsPageDetail=R
ShowSMTPErrorsStats=0
ShowClusterStats=0
AddDataArrayMonthStats=1
AddDataArrayShowDaysOfMonthStats=1
AddDataArrayShowDaysOfWeekStats=1
AddDataArrayShowHoursStats=1
IncludeInternalLinksInOriginSection=0
MaxNbOfDomain = 10
MinHitDomain  = 1
MaxNbOfHostsShown = 10
MinHitHost    = 1
MaxNbOfLoginShown = 10
MinHitLogin   = 1
MaxNbOfRobotShown = 10
MinHitRobot   = 1
MaxNbOfDownloadsShown = 10
MinHitDownloads = 1
MaxNbOfPageShown = 10
MinHitFile    = 1
MaxNbOfOsShown = 10
MinHitOs      = 1
MaxNbOfBrowsersShown = 10
MinHitBrowser = 1
MaxNbOfScreenSizesShown = 5
MinHitScreenSize = 1
MaxNbOfWindowSizesShown = 5
MinHitWindowSize = 1
MaxNbOfRefererShown = 10
MinHitRefer   = 1
MaxNbOfKeyphrasesShown = 10
MinHitKeyphrase = 1
MaxNbOfKeywordsShown = 10
MinHitKeyword = 1
MaxNbOfEMailsShown = 20
MinHitEMail   = 1
FirstDayOfWeek=1
ShowFlagLinks=""
ShowLinksOnUrl=1
UseHTTPSLinkForUrl=""
MaxLengthOfShownURL=64
HTMLHeadSection=""
HTMLEndSection=""
MetaRobot=0
Logo="awstats_logo6.png"
LogoLink="http://www.awstats.org"
BarWidth   = 260
BarHeight  = 90
StyleSheet=""
color_Background="FFFFFF"               # Background color for main page (Default = "FFFFFF")
color_TableBGTitle="CCCCDD"             # Background color for table title (Default = "CCCCDD")
color_TableTitle="000000"               # Table title font color (Default = "000000")
color_TableBG="CCCCDD"                  # Background color for table (Default = "CCCCDD")
color_TableRowTitle="FFFFFF"    # Table row title font color (Default = "FFFFFF")
color_TableBGRowTitle="ECECEC"  # Background color for row title (Default = "ECECEC")
color_TableBorder="ECECEC"              # Table border color (Default = "ECECEC")
color_text="000000"                             # Color of text (Default = "000000")
color_textpercent="606060"              # Color of text for percent values (Default = "606060")
color_titletext="000000"                # Color of text title within colored Title Rows (Default = "000000")
color_weekend="EAEAEA"                  # Color for week-end days (Default = "EAEAEA")
color_link="0011BB"                             # Color of HTML links (Default = "0011BB")
color_hover="605040"                    # Color of HTML on-mouseover links (Default = "605040")
color_u="FFAA66"                                # Background color for number of unique visitors (Default = "FFAA66")
color_v="F4F090"                                # Background color for number of visites (Default = "F4F090")
color_p="4477DD"                                # Background color for number of pages (Default = "4477DD")
color_h="66DDEE"                                # Background color for number of hits (Default = "66DDEE")
color_k="2EA495"                                # Background color for number of bytes (Default = "2EA495")
color_s="8888DD"                                # Background color for number of search (Default = "8888DD")
color_e="CEC2E8"                                # Background color for number of entry pages (Default = "CEC2E8")
color_x="C1B2E2"                                # Background color for number of exit pages (Default = "C1B2E2")
ExtraTrackedRowsLimit=500
 
Hi, @ic3_2k . No, I doubt that editing the value of "SkipHosts" will solve the issue with the stuck processes. As far as I am aware, the parameter defines what to be skipped for skipped in statistics gathering rather than updating. My guess was that DynamicDNSLookup=0 might be missing, but I can see it's there.

Could you please try executing:

Code:
ps aux | grep anacron

if there's an output similar to:

Code:
root PID  0.0 0.0 234724 2728 ? Ss Nov27 0:00 /usr/sbin/anacron -s

try:
Code:
pstree -capl PID
 
I think it's a very basic, general issue with AWStats. We started seeing it once we moved from CentOS 7 to Alma 8. It preferrably occurs on "localhost", rarely on a client domain, but sometimes on a client domain, too. It might be caused by log files too large and a bug in AWStats that get's stuck in such cases. It could be a bug independent of the log file size. We never found out, but it's certainly not solvable by any configuration change. The only way we found is to monitor the process list and kill the AWStats process that uses >98% of one CPU core for more than n minutes (typically something around five minutes will perfect).
 
So the best is to remove completely awstats?
In my case is happening with the localhost local domain, and the name from reverse IP DNS register.
Also with one of the client domains (the most big and annoying of them), it always got hung with this domain, it get a big log file, tried to truncate several times, but I don't know what else more to do...
 
Back
Top