How can I boost the speed of notification?

How can I boost the speed of notification?

by Mahinwal Surya -
Number of replies: 4

Hi all,

I have created a broadcast message custom plugin. This is basically used for to send notification to all the student. students are using moodle mobile app for study my course. Currently we have 1000+ students  for this process. Whenever I have send the notification message to students. It takes around 30 minutes in this process.

Is there any suggestion to boost up the speed of notification?


Thanks and regards

Mahinwal

Average of ratings: -
In reply to Mahinwal Surya

Re: How can I boost the speed of notification?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm not sure how we can answer this... we didn't write your plugin. What have you done to profile it and figure out what the slow bit is?
In reply to Howard Miller

Re: How can I boost the speed of notification?

by Mahinwal Surya -
I have used the ad-hoc cron process for the same. When I have run cron then notification will sent to students. i think ad-hoc cron causing the issue here.

Please provide any suggestion for sending the notification to 1000+ student with in a minute. if you had the same requirement then what approach will be follow?

Thanks in advanced
Mahinwal
In reply to Mahinwal Surya

Re: How can I boost the speed of notification?

by Ken Task -
Picture of Particularly helpful Moodlers

Having had some experience at mail servers ...

Are all the receipients on the same mail server system?  Where you control where the mail is sent as well?

If not, even if you configure your moodle server as best you can, email servers on other might reject ... you could then have a flood of failed notifications coming back to the mail services on your moodle ... thus eating up resources and taking away from normal moodle processing.

Whatever server is set up to send 1000+ messages had better have spotless mx, dkim, spf, and any other config for the blockhole/spam checkers.
Normally, one does not have their moodle server set up as a mail server as well.


Your answer/solution ... me thinks ... a very robust SMTP relay that does have mx,dkim,spf, etc. and that you can control ... SendGrid?  Mailgun? or other such SMTP relay is advised.

Nearly all mail servers have sending limits - number of messages ... and it's not 1000+ in one minute.

Note also that PHP's mail() function opens a new socket for every mail sent. If you're looping through a large recipient list and sending a message to each one individually, you could quickly run out of sockets.

A realistic expectation should be taken.

https://sendgrid.com/
https://www.mailgun.com/

You might consider mailman on a dedicated server.
https://www.list.org/

Now if you are wondering how this forum manages to send mail to many users, consider that behind this server interface is Amazon - probably more than one server ... and located in multiple geographic locations.   Check the header of a message you get from this server to get an idea.

'spirit of sharing', Ken

In reply to Mahinwal Surya

Re: How can I boost the speed of notification?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
When you say notifications - can you explain exactly what you mean.

In Moodle an "notification" is a thing (https://docs.moodle.org/dev/Notifications) - clearly, not what you are talking about.

Ken thinks you mean mail, but I am not so sure. Why did you decide to use an ad-hoc task? I'm not saying it's wrong, I just want to know why.

Again, what have you done (I'm guessing nothing) to profile your current solution?