Blank screen (PHP memory?)

John Bryan - May 12, 2008 - 23:23
Project:BAWStats
Version:6.x-1.0-2
Component:Code
Category:bug report
Priority:critical
Assigned:anaru
Status:active
Description

The Apache errorlog (/var/log/httpd/error_log) shows the following:-

[Mon May 12 23:02:48 2008] [error] [client x.x.x.x] PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 1681 bytes) in /home/xxxxx.com/public_html/sites/all/modules/bawstats/core/helpers.inc.php on line 306

PHP memory limit is already at 64mb so I am really reluctant to increase it further. This site typically has 15 visitors at a time so the site already needs about 1gb of memory already. I am running with:-

- Bawstats 6.x-1.0-2
- Drupal 6.2

May be coincidental but did have a working report display (although un-filtered i.e. all domains) before upgrading from Drupal 6.1 to 6.2 but I did not test immediately after the upgrade.

In the mean time will look for anything hoging the PHP memory at my end.

Regards

John Bryan

#1

anaru - May 13, 2008 - 07:41
Assigned to:Anonymous» anaru

I have seen this before on page views containing multiple domain information. I have passed this along to the betterawstats maintainer. I will pass back any feedback/bugfixes from them.

#2

John Bryan - May 13, 2008 - 10:47

Further Information

Two problems exists:-
- Memory hungry behaviour causes WSOD
- Failing to filter results by domain

Memory usage

Whilst the DEVEL module typically reports approx 10mb used at the end of creating pages, unfortunately it does not report on the peak memory usage during page rendering. This is definitely more than 64m as it starts working when I increase the PHP memory limit on the development site.

Memory used at: devel_init()=0.93 MB, devel_shutdown()=10.41 MB.

Memory usage seems to be a known problem with BeterAWSTATS and the only real advice from them seems to be to split the AWSTATS data files into per domain. Unfortunately for me the domain I want to report on is 98% of the servers traffic so that would not make any diference. The reason I installed Bawstats was that I have a fairly high traffic site that needs comprehensive analysis i.e. approx 1,000 unique visitors a day and 10,000 pages displayed a day and typically 15 visitors at a time.

BAWSTATS configuration

Since adding the following a drop down list is displayed allowing me to select from the available awstats configuration files (i.e. usually one per domain).
\sites\default\settings.php$conf['bawstats_defsite'] = 'clivejames.com';

The problem is that which ever domain I select the stats are identical. Possibly this is an AWSTATS configuration problem?.....

AWSTATS configuration

Currently two Awstat config files have been created. It is the "client-domain" I want to view stats on i.e. filtered without other domain information. At the moment I am seeing all the stats together (if I hike the PHP memory limit to an unsustainable level).

/etc/awstats/awstats.own-domain.com

# AWSTATS CONFIGURE FILE 6.6
#-----------------------------------------------------------------------------
# Copy this file into awstats.www.mydomain.conf and edit this new config file
# to setup AWStats (See documentation in docs/ directory).
# The config file must be in /etc/awstats, /usr/local/etc/awstats or /etc (for
# Unix/Linux) or same directory than awstats.pl (Windows, Mac, Unix/Linux...)
# To include an environment variable in any parameter (AWStats will replace
# it with its value when reading it), follow the example:
# Parameter="__ENVNAME__"
# Note that environment variable AWSTATS_CURRENT_CONFIG is always defined with
# the config value in an AWStats running session and can be used like others.
#-----------------------------------------------------------------------------
# $Revision: 1.327 $ - $Author: eldy $ - $Date: 2006/04/21 22:28:49 $

#-----------------------------------------------------------------------------
# MAIN SETUP SECTION (Required to make AWStats work)
#-----------------------------------------------------------------------------

LogFile="/var/log/httpd/access_log"
LogType="W"
LogFormat="1"
LogSeparator=" "
SiteDomain="own-domain.com"
HostAliases="own-domain.com www.own-domain.com 127.0.0.1 localhost"
DNSLookup="2"
DirData="/var/lib/awstats"
DirCgi="/cgi-bin"
DirIcons="/icon"
AllowToUpdateStatsFromBrowser="0"
AllowFullYearView="2"

/etc/awstats/awstats.client-domain.com

# AWSTATS CONFIGURE FILE 6.6
#-----------------------------------------------------------------------------
# Copy this file into awstats.www.mydomain.conf and edit this new config file
# to setup AWStats (See documentation in docs/ directory).
# The config file must be in /etc/awstats, /usr/local/etc/awstats or /etc (for
# Unix/Linux) or same directory than awstats.pl (Windows, Mac, Unix/Linux...)
# To include an environment variable in any parameter (AWStats will replace
# it with its value when reading it), follow the example:
# Parameter="__ENVNAME__"
# Note that environment variable AWSTATS_CURRENT_CONFIG is always defined with
# the config value in an AWStats running session and can be used like others.
#-----------------------------------------------------------------------------
# $Revision: 1.327 $ - $Author: eldy $ - $Date: 2006/04/21 22:28:49 $



#-----------------------------------------------------------------------------
# MAIN SETUP SECTION (Required to make AWStats work)
#-----------------------------------------------------------------------------

LogFile="/var/log/httpd/access_log"
LogType="W"
LogFormat="1"
LogSeparator=" "
SiteDomain="client-domain.com"
HostAliases="client-domain.com www.client-domain.com client-domain.info www.client-domain.info"
DNSLookup="2"
DirData="/var/lib/awstats"
DirCgi="/cgi-bin"
DirIcons="/icon"
AllowToUpdateStatsFromBrowser="0"
AllowFullYearView="2"

Links

"Blank page only for some months... due to PHP memory limit" http://betterawstats.com/forum/viewtopic.php?f=2&t=23

#3

egfrith - September 30, 2009 - 21:26

Hello John,

thanks for the information and sorry for the delay in getting back to you; I took over maintaining this module a few months ago. I'm not yet familiar enough with the code to suggest a fix to this, and it will probably take me months to get round to fixing this. However, if you make any progress, I'd be very happy to commit a patch, subject to review.

 
 

Drupal is a registered trademark of Dries Buytaert.