News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Maximum amount of emails to send per page load?

Started by wakewatcher, January 22, 2009, 08:17:18 PM

Previous topic - Next topic

wakewatcher

smf 2.0.18


karlbenson

IIRC its Admin > Forum Maintenance > Mail Settings.

The setting refers to what is the maximum number of emails that can be sent out every time the page is loaded.
page load = a pageview.

Eg 5 means max 5 emails per page load.

Higher means the page load can be slower.

charlottezweb

Interesting, haven't seen that before.  I'm still confused though...

When & why would a pageload prompt an email?

karlbenson

If your using the mailbox functionality in smf 2.x which sends emails as scheduled task (so you don't get over any hourly / daily mail limits).

eg you send a newsletter to email to your 1000 members. But your host has a limit of 200 per hour.
Using the mailbox you can throttle smf sending to 200 per hour.

This setting helps decide how that 200 are sent.
Since SMF doesn't use cron, the automated tasks checks are performed silently and in the background on pageviews.

So your basically decidng on each pageload, what is the max no. of emails that SMF can send.

charlottezweb

Thanks regularexpression,

As I host, I understood everything you wrote except the last sentence.  I don't get how a "pageload" would prompt emails?

karlbenson

On loading a page, there is a call to check whether there are any scheduled tasks to perform. And if so it does some of them.

= Page requested
= Checks/Calls automated task (including mail if theres any to be sent)
= Loads the page requested

When the emails were sent, they are stored in a table in smf and not actually sent out.
Then as part of scheduled task SMF just pulls some of them and sends them on each page view.

So pageload won't prompt emails.
(it is done silently behind the scenes, there is no indication to the user or guest that that pageview performed a scheduled task).

charlottezweb

Ah, so every pageload prompts a check against the SMF mail queue?

That seems like it may need some clarification if it's going to be a standard part of smf's admin area.  That doesn't seem like something that is "common sense" to me to include in the admin area.

karlbenson

Not everypage load.

What is not common sense?
Its an admin setting hence it should be in the admin?

Maybe I've not explained it properly.

charlottezweb

Quote from: regularexpression on January 22, 2009, 10:49:09 PM
Not everypage load.

What is not common sense?
Its an admin setting hence it should be in the admin?

Maybe I've not explained it properly.

Ok, here's what I'm envisioning and maybe that's the problem...

It seemed like the rules are based on email throttling.  So, for example, on some of my servers I have email limited to 500-1000 emails sent per account per hour.  So my thought around this setting is that someone knows their account has a certain amount of email they are allowed to send (per hour).

Now, when you say, per pageload -- I don't know what that means.  You could have a thousand pageloads in an hour.

As a normal SMF user running an average board, how would I know what I need to set this value to?  How would I know what pageloads prompt emails?  That's what I was asking basically.  :)

karlbenson

There is an hourly setting aswell eg max 200 per hour.

This setting more refers to how to break it down within that 200.

eg do you send 50 at a time, (and get it over with quickly).
or more balanced and send 1 per page load.

The admin/user doesn't need to know which of his pageviews sends which emails. Just trust smf to do it silently.
(just as most other throttling/mailbox scripts in other software you may have used).

charlottezweb

So wouldn't it be more prudent to have checkboxes like:

"Enable Mail Queue"  (y/n)  ____
"Maximum to Send per hour"  ___

And then have SMF calculate/throttle it from there?

Me as "Joe User" will have no idea what to put in the "maximum amount to send per page load" field.

That's just my personal opinion :)

karlbenson

- While it is a more of a feature for advanced control over it, I don't think its too complicated to understand.
- SMF can't really calculate it as hits per hour aren't stored and hourly pageviews vary.

Although really you can't go wrong with the setting.

Although I would suggest making a feature request/bug report if you think it should be altered.

wakewatcher

As the originator of this post I can't see how "maximum amount to send per page load" can have much meaning.  While I can get a grip on "Maximum emails to send per minute" per minute.  My host claims 300 per hour so I suppose I should set it to 5 per minute.  It would be cool if there were an additional parameter for "emails per hour" that way smf could see that for example the 300 haven't been hit when a bunch shows up so send out more than the 5 to get to the limit for that hour.
smf 2.0.18

wakewatcher

Are these two email fields independent?  I set the emails per minute to 5 and left the emails per page load to 0.  But seems to be producing odd results.  I (myself) have two accounts with different email addresses.  Both administration accounts but one with a Admin username.  I used to get email notifications to both but now it only sends to one.  And my wife isn't getting any.  People seem to get notifications when start or reply to topics but not general notifications when others add a topic.  Anyway I'm still not groking (or is that grokking) the relationship between the two variables and what's happening with my email.  (using php mail if that matters.)
smf 2.0.18

karlbenson

They are not independant.

Whatever "emails per load" is set to, it will never in total exceed 300 per hour.

eg
max per hour = 100
max per load = 10

Once it has sent out 10 loads worth, it will have reached the limit and stop sending out until the next hour.

If email is not been received, and there is no remaining emails left in your mailbox in smf to be sent out, then thats probably a different issue.

Also note, users do NOT get notifications about new topics, unless its posted in a board, that they have requested board notifications for.




If your looking for an example amount for emails per page load, I'd suggest 5-20
And for emails per hour, 300

wakewatcher

Thanks.  A couple of things. The smf parameter is actually max emails per minute. So if I have a 300 email per hour limit then that becomes 5 per minute.  So specifying anything greater than 5 per page load wouldn't make sense. right? Seems like a better parameter would have been maximum per hour.  In any case max per load must be less than or equal to max per minute. right?

Also all of my users default to instant notifications on all boards as I have set it up that way to hopefully generate more posts BUT something is flaky as it isn't working.
smf 2.0.18

greyknight17

This is what is posted at the online manual
QuoteMaximum emails to send per minute - Set how many emails per minute you want to be set. If your host sets a limit of emails per hour, you should divide that number by 60 and use that number or a number lower than that in this field.
Maximum amount of emails to send per page load - Set how many emails per page load to send if any emails exists in the queue. ! Note: Setting this to a higher number can cause pages to take longer to be displayed.
Will try to find out exactly what the page load means in this case also.

Definitely do not set that value to a very high number.

If this issue is resolved now, you may mark it as solved.

Paracelsus

Sorry to bring back this topic, but I just tried this system and, having similar problemas, I have to agree that it is a bit... flawed.

For example:

- In my case I have 2500 emails to send and a limit of 1000 emails per hour to send.
- I check the Mail queue box.
- I configure the option Maximum emails to send per minute to 15 (15x60=900)
- Then it's a bit hard to understand the next parameter, so I try two options:

Option 1: I configure the Maximum amount of emails to send per page load to 950

Option 2: I configure the Maximum amount of emails to send per page load to 15 or 0

Results:
- If I use option 2, everything is fine ;D - the emails are sent at a maximum rate of 15 per minute, whether I refresh tons of times per second or not.
- If I use option 1, everything is wrong >:( - 950 emails are sent the first time I hit refresh, the second time I hit refresh the list gets 950 shorter and by the third refresh the list is gone... all emails are sent, though I had set the limit to 15 emails per minute! (I received more than a 1000 error messages on the webmaster email all at the same time so I know the emails were actually sent and not put on relay or something like it)

So, it seems that the option: Maximum amount of emails to send per page load somehow overrides the option of max emails per minut. In my case this override happened when the value was above the maximum per minut or hour but not when it was equal or below the max per minut.

A final suggestion about the pageview process that has to happen in order for the queue to move forward. Wouldn't it be easier to put a checkbox option for som sort of internal page autoreload as long as there is a queue?

Advertisement: