Retroactive notifications?

Author Message

Eirik Alfstad Johansen

Sunday 23 November 2008 6:07:41 am

Hi guys,

My experience with notifications is fairly limited, so I thought I would try it out on our own site. However, I'm running into some problems that I was hoping someone could help me out with.

Here's what I did (on a 4.0.0 install).

1. Added two site folders as items to my notifications list.

2. Ran the runcronjobs.php script with the frequent flag, using the following command:

cd /home/path/to/ez;/usr/local/bin/php -C /home/path/to/ez/runcronjobs.php frequent

When I do, I get the following message:

===
Running cronjob part 'frequent'
Running cronjobs/notification.php
Starting notification event processing

Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to allocate 491520 bytes) in /home/nm/public_html/ezpublish-4.0.0/var/ezwebin_site/cache/template/compiled/plain-cc0c8da99c82bcf15a6210dfd8c38a86.php on line 335

Fatal error: eZ Publish did not finish its request
The execution of eZ Publish was abruptly ended, the debug output is present below.
===

When I open the cache file in question, the first few lines look like this:

===
// URI: design:notification/handler/ezsubtree/view/plain.tpl
// Filename: design/base/templates/notification/handler/ezsubtree/view/plain.tpl
// Timestamp: 1205407378 (Thu Mar 13 12:22:58 CET 2008)
===

...and lines 334 and 335 look like this:

===
$var2 = ( array_key_exists( $rootNamespace, $vars ) and array_key_exists( 'object', $vars[$rootNamespace] ) ) ? $vars[$rootNamespace]['object'] : null;
$var3 = compiledFetchAttribute( $var2, 'main_node_id' );
===

Also, I receive 100+ emails containing notifications of nodes that were changed a long time ago. So there's two specific problems here:

1. The script won't execture successfully.
2. I would image that I should only get notifications from the point of which I subscribed. As of now, the notifications seem to have a retroactive effect.

Thanks in advance !

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

John Smith

Monday 08 February 2010 8:02:03 am

Hi Eirk,

Upto now you must have solved problem. Hope you can help me as well. This morning I am getting same sort of errors while running runcronjobs.php. Already checked php.ini for all memory settings, they seems fine.

EZcrew any help please.

Eirik Alfstad Johansen

Monday 08 February 2010 9:03:14 am

Hi John,

Sorry, but I can't remember if I ever got this working, and if I did, I can't remember how. :(

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

John Smith

Monday 08 February 2010 9:21:56 am

No problem mate, thanks for your swift reply.

Hopefully someone from ezCrew will help. Wasted whole day in digging the cause. Anyhow I am using eZ4.0.1. There are few sites on the same server. One running runcronjob.php OK, but the other giving the above as you mentioned. I dont know what I have done wrong.

Cheers,

John Smith

Monday 08 February 2010 9:28:34 am

Output from the website which is running ok....

Running cronjob part 'frequent'
Running cronjobs/notification.php
Starting notification event processing
Done
Running cronjobs/workflow.php
Checking for workflow processes
Status list
0 out of 0 processes was finished
#################################### DEBUG ####################################
Timing: ()
Script cronjobs/notification.php starting
Timing: ()
Script cronjobs/notification.php done
Timing: ()
Script cronjobs/workflow.php starting
Timing: ()
Script cronjobs/workflow.php done
Script cronjobs/notification.php starting 0.0000 sec0.0687 sec
Script cronjobs/notification.php done 0.0687 sec0.0004 sec
Script cronjobs/workflow.php starting 0.0690 sec0.0109 sec
Script cronjobs/workflow.php done 0.0800 sec
Total runtime: 0.0924 sec
Peak memory usage: 9,833.6875 KB
Group ini_load:
Load cache: 0.0102 sec (6.9901%), 0.0015 avg sec (7)
FindInputFiles: 0.0053 sec (3.6366%), 0.0008 avg sec (7)
Group Mysql Total:
Mysqli_queries: 0.0054 sec (3.7025%), 0.0004 avg sec (13)
Looping result: 0.0001 sec (0.0541%), 0.0000 avg sec (2)
Total script time: 0.1458 sec

Output for the website which is creating errors:

Running cronjob part 'frequent'
Running cronjobs/notification.php
Starting notification event processing

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 491520 bytes) in /var/www/xxxx/xxxxx/xxxx/web/var/plain_site/cache/template/compiled/plain-e94d3e17c666661c8bf131bc6e5d5c95.php on line 335

Fatal error: eZ Publish did not finish its request
The execution of eZ Publish was abruptly ended, the debug output is present below.
Timing: ()
Script cronjobs/notification.php starting

Script cronjobs/notification.php starting 0.0000 sec
Total runtime: 1.6396 sec
Peak memory usage: 19,438.1953 KB
Group ini_load:
Load cache: 0.0135 sec (0.7966%), 0.0013 avg sec (10)
FindInputFiles: 0.0055 sec (0.3228%), 0.0005 avg sec (10)
Group Mysql Total:
Mysqli_queries: 0.1754 sec (10.3623%), 0.0001 avg sec (1199)
Looping result: 0.0354 sec (2.0936%), 0.0000 avg sec (918)
Group Template Total: 0.7706 sec (45.5%), 0.0203 avg sec (38)
Template load: 0.0604 sec (3.5699%), 0.0015 avg sec (39)
Template processing: 0.7091 sec (41.9008%), 0.0187 avg sec (38)
Group override:
Cache load: 0.0199 sec (1.1778%), 0.0005 avg sec (39)

Total script time: 1.6924 sec

John Smith

Wednesday 10 February 2010 12:31:27 am

So this is only me who is getting these sort of errors????

Bruce Morrison

Wednesday 10 February 2010 1:08:49 am

Hi John

I'm assuming you are getting the "Fatal error: Allowed memory size of X..." error?

This is because the script is using all the memory allocated to it.

You can either increase the memory limit in php.ini or add an option to the command line

 cd /home/path/to/ez;/usr/local/bin/php <b>-dmemory_limit=64M</b> -C /home/path/to/ez/runcronjobs.php frequent

Hope this helps.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

John Smith

Wednesday 10 February 2010 2:35:34 am

Thats what I am looking for, why the script needs that much memory. I have not done anything special to the website. Website is already on 2 x quad core with 16GB of memory sort of server.

Anyway in php.ini the settings are:

Maximum size of post data (text and files) is 24M.

Script memory limit is 256M.

Maximum execution time is 360 seconds.

John Smith

Wednesday 10 February 2010 3:22:30 am

The website does not throw the following error on regular basis. I been running the frequent in cronjob for a day or so at 15th minute of an hour.

Got the same this morning:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 491520 bytes) in /var/www/xxxx/xxxxx/xxxxx/plain_site/cache/template/compiled/plain-e94d3e17c666661c8bf131bc6e5d5c95.php on line 335

John Smith

Thursday 11 February 2010 12:52:02 am

Any one else please????

Nicolas Pastorino

Thursday 11 February 2010 1:19:22 am

Hi John,

From your paste above, the memory_limit value taken into account is 33554432 bytes, ie 32MB. This is too low, definitely. Although you believe the memory_limit value is 256M, it is not for the CLI version of PHP, most obviously. You either need to follow Bruce's advice and run the runcronjobs.php script with the -d option, overriding the memory_limit value:

cd /home/path/to/ez;/usr/local/bin/php -dmemory_limit=256M -C /home/path/to/ez/runcronjobs.php frequent

Would you mind trying this one above and let us know ?

Cheers John,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

John Smith

Thursday 11 February 2010 2:19:59 am

Hi Nicolas,

Thanks for your kind explanation. Actually I was in the impression that if I change the memory limit to 256M in php.ini, the CLI version of php will pick it. So from where CLI version of PHP is picking the value of 32M.?

As I said cronjob is running at every 5th minute of an hour for different websites. Yesterday I got the error one time during the mid day for website2 (see below), other wise it is running fine. Is it worth changing the cronjob to the following:

10 * * * * cd /var/www/xxxx/xxxxx/website1; /usr/bin/php -dmemory_limit=128M -C runcronjobs.php frequent 2>&1

15 * * * * cd /var/www/xxxx/xxxxx/website2; /usr/bin/php -dmemory_limit=128M -C runcronjobs.php frequent 2>&1

20 * * * * cd /var/www/xxxx/xxxxx/website3; /usr/bin/php -dmemory_limit=128M -C runcronjobs.php frequent 2>&1

25 * * * * cd /var/www/xxxx/xxxxx/website4; /usr/bin/php -dmemory_limit=128M -C runcronjobs.php frequent 2>&1

By doing these I will be allocating massive amount of memory resources towards runcronjobs every 5th minute of an hour. Is it worth?

Nicolas Pastorino

Thursday 11 February 2010 2:48:50 am

Hi John,

depending on which OS you are running eZ Publish on, the php configuration may be split into to different files, one for module/cgi runtime, one for CLI runtime. Two solutions are at your disposal now :

  • Override the php-cli configuration for any CLI run (after having found the location of the configuration file; you should be able to see it by running, form the command line : php -i | grep -i 'Loaded Configuration File' )
  • Override the php-cli configuration on a per script basis, as proposed in Bruce's post. You should not worry about the memory used. You'd rather have a properly running script, maybe eating 2 or 3 additional MBs of RAM, than having a non-functional solution. You can first try to increase the memory_limit to 64MB. And then incrementally adjust this value of you spot new crashes.

Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.