Memory usage low to medium traffic website


#1

Hi,

we have approximately 3000 visits per day on our site.

Is it with this number of visits plausible, that we run in the memory-limitation of 128MB per PHP-process?

I don’t think, that this is a so high number?

(If we raise the memory-limit per PHP-process up to 512MB the error disappears.)

Rikky


(Matthieu Aubry) #2

Yes it is normal, 3000 visits is enough to go over 128M (which is not a lot for PHP when working with lot of data)


#3

Hi Matt,

I’m glad that my memory-issues are quite normal. Not normal is the behaviour of our piwik-1.6-installation after fine-tuning the memory-settings of the php-scripts.

I set the php_memory_limitation for the apache-process to 512M, which seemed to work fine.

And I also changed the php_memory_limitation for the command line (cli) in the script \misc\cron\archive.sh: I added the line


PHP_BIN = "$PHP_BIN -d memory_limit=512M"

after setting PHP_BIN in the script \misc\cron\archive.sh. (Due to administrational restrictions I may not alter the php.ini for the cli and it seems, that \piwik\config\config.ini is not evaluated when launching \misc\cron\archive.sh)

That means every call to PHP_BIN in archive.sh has now a memory_limit of 512M.

Now I have problems with my email-reports. If the reports get a little bigger the email-report-sending fails.

Error-Message:


PHP Fatal error: Call to undefined function imagecreatefrompng() in /opt/piwik/libs/tcpdf/tcpdf.php on line 7887, referer: http://www.mysite.de/index.php?module=PDFReports&action=index&idSite=1&period=day&date=yesterday

If I reduce the statistics included in an email-report the email-sending works. GD is installed on the server. And no, I can’t try out 1.7beta on this system. :frowning:

Any idea what I could try?

Is it possible that - with my $PHP_BIN -d memory_limit=512M - I accidentally reduced a higher memory_limit than 512M in archive.sh which causes the report-sending to fail now?

Regards, Rikky


(Matthieu Aubry) #4

Call to undefined function imagecreatefrompng --> probably GD not working properly, check your PHPINFO for GD2 etc. (or look the error online)