Suddenly cron began failing on my site and after much digging, it appears to be due to the Notify module timing out. When Notify is disabled, cron works, when it is enabled, it fails with a timeout message. I have tested Notify by trying to use it to contact an individual user and the same failure occurs (so it isn't the number of users being notified). I've searched for related errors and checked everything I can find with no success. There are no other errors in either the Drupal log or the web site logs that are apparently related. My only supposition is this: Notify times out waiting for the system to accept an e-mail message but why I don't know.

I'd appreciate any clues on where to look. Thanks.

Comments

rkdesantos’s picture

If additional info is needed before I can get a response, please advise. Thanks.

jtjones23’s picture

I'm having the same issue but I suspect it has more to do with the fact that I imported 4,000 CCK nodes. After disabling Notify, cron runs just fine. Is there a limit on the number of nodes that can be sent in one notification?

rkdesantos’s picture

Since activity on Notify has resumed, I wondered if this could now be looked into?

matt2000’s picture

Status: Active » Postponed (maintainer needs more info)

In all honestly, notify module is probably not well suited to high-content or high-traffic sites. (Doubly so for notify by views, which currently has to re-build the view for each message being sent.)

In any case, @rkdesantos, the solution to you cron timeout is probably in modifying your php.ini to increase the max_execution_time and or memory_limit, or adding ini_set('max_execution_time', 600); at the top of cron.php (for 10 minutes. increases as needed at your own risk.)

rkdesantos’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for the response.

I had to modify .htaccess to get the new values to work. Here is what I have at present:

max_execution_time = 360
memory_limit=128M

With these values, notify seems to work most of the time and cron completes, though sometimes it takes 3 to 5 minutes to do so. Why it should take settings this high with only ~20 users to be notified I still am not clear about. I have posted a request in the Subscriptions module issues area asking for advice in moving to that module as that seems to be the advice I am getting here.

matt2000’s picture

Status: Active » Fixed

Notify uses core's drupal_mail function for mail delivery, so it's doubtful that any inefficiencies in the actually sending of mail is unique to notify module. (It's possible Subscriptions uses some other method? I haven't looked.) I'd suggest you look further into your server configuration if you wish to continue using notify. I manage sites that send notifications to many hundreds of users every day without difficulty.

Marking as fixed, since you've had successful cron completion.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.