Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 4243

cron - php memory issue possible solution (1 reply)

$
0
0
Hi,

My company start to use piwik for some time by now and everything is working as smooth as silk except the archive part.

We have try a cron with a wget to the url of archive.php and call the piwik console directly from a cron job. The both gave the sometimes the same output no matter what memory_limit configuration in php:

ERROR CoreConsole[2014-08-14 16:54:21] [c5b89] Got invalid response from API request: http://analytics.stg.online.xl.pt/index.php?module=API&method=API.get&idSite=5&period=month&date=last20&format=php&token_auth=3f5baeebed3ccb8951c93f2cb1c1e1a0&trigger=archivephp. Response was 'PHP Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 32 bytes) in /var/www/html/analytics/www/core/DataTable.php on line 1155 '

Have floowed some solutions found on this board and on some blogues but none of them seems to work nor the increse of memory_limit in php.ini configuration (by now we are using 2048M and the value on the error keep on show the 805306368 bytes).

Now we are running the cron passing the memory_limit value but it seems that in the recurrent requests made by the piwik console this variable is not passed to it. For exemple the first request is

/usr/bin/php -d memory_limit=2048M /var/www/html/analytics/www/console core:archive --url=http://analytics.stg.online.xl.pt/ > /var/www/html/analytics/logs/archive.log

but the next nested request goes as

/usr/bin/php -q /var/www/html/analytics/www/console climulti:request --piwik-domain=analytics.stg.online.xl.pt module=API&method=API.get&idSite=4&period=day&date=last2&format=php&token_auth=3f5baffbed3ecb8996c93f2cbbc1eca1&trigger=archivephp&pid=19fa5e574293c421b5208b0fb016d9e2909450cf8db8891010c289bcfc839902e8852c7ab9c691bb4f32dfc388143c33fa970.

Note that the memory_limit var is "lost".

It seems that is one recursive request that consumes all the memory. It would be a solution pass to it the memory_limit as in the first console call?

Just an ideia...

Pedro

Viewing all articles
Browse latest Browse all 4243

Trending Articles