Are there any performance hits switching to SMTP over the mail() function in VB? We have a cluster of servers on our network and I was thinking about using just 1 for sending mail. Would this be significantly slower than using mail()?
Performance: SMTP Or Mail()
Collapse
X
-
Here are some pointers:
- the mail() function may use internal pipes to call the sendmail process over the same server, this can be a little faster, although not for that much, than sending it over sockets on the network
- unless your cluster is a really weird setup, and assuming that all the servers are connected to the same switch, sending a mail over smtp would be really fast
- centralizing the mail sending could be a really really good idea, since you have only one failure point in the event that the mail is not relayed. Administration-wise, it is a good idea to have this
- Depending on the tool you are using for load-balancing (pen,pound,fcgi farm, something more?) you may be able to configure a lower load for the server dedicated to the mail process
- Security wise, you need to take extra steps to make sure that the smtp server you configure isn't open for relay and thus can't be used as a spam gateway, and that only your server cluster is able to send mail through it
How big is your fourm? Unless you are sending thousands of emails most likely you won't see any performance penaltyCemZoo Wiki - The complete anime encyclopedia
CemZoo Foros - Spanish Anime & Gaming Community (also browse our archive) -
We are sending out many thousands a day and have millions of posts.
Right now we get spikes of traffic where we can have almost 20,000 users constantly hitting the refresh button over and over for up to 5 minutes to get certain information we release. This creates quite a load as you can imagine. We have put together many methods are reducing our load from the main httpd servers, and one technique is offloading duties to other servers that do not serve pages.
Example, like many other large boards, we have separated our DB tasks from our httpd servers.
We now want to offload all of the mail functions to another server that is not serving http, but just a utility server. It has always been my thought that making one server do the mail duties is better than all of them doing it.
My only concern is, even though the connection is on the same switch, would there be any lag time due to the connections? Realize, when a few thousand users are banging on one server over and over in a minute, every little performance gain is a plus.Comment
-
Since my apache servers are using Postfix, I decided to configure it to use the relay server instead:
Code:relayhost = [123.255.123.5]
I have a sneaky suspicion that the Mail() function is faster.Comment
-
We are sending out many thousands a day and have millions of posts.
Right now we get spikes of traffic where we can have almost 20,000 users constantly hitting the refresh button over and over for up to 5 minutes to get certain information we release. This creates quite a load as you can imagine. We have put together many methods are reducing our load from the main httpd servers, and one technique is offloading duties to other servers that do not serve pages.
Example, like many other large boards, we have separated our DB tasks from our httpd servers.
We now want to offload all of the mail functions to another server that is not serving http, but just a utility server. It has always been my thought that making one server do the mail duties is better than all of them doing it.
My only concern is, even though the connection is on the same switch, would there be any lag time due to the connections? Realize, when a few thousand users are banging on one server over and over in a minute, every little performance gain is a plus.
offloading the mail could be indeed a good idea
I have been under that scenario you described, 20,000 users hitting refresh, for that, instead of load balancing, a proxy cache is also a good solution, provided it is viable for you. A trill to have it setup properly but it works as it frees the server from any php processingCemZoo Wiki - The complete anime encyclopedia
CemZoo Foros - Spanish Anime & Gaming Community (also browse our archive)Comment
-
You would also want to play with the "batch email" configuration at the vbulletin options, it can either send the mail immediately, or queue it and send them in batch each n minutes defined by a vBulletin cron job
offloading the mail could be indeed a good idea
I have been under that scenario you described, 20,000 users hitting refresh, for that, instead of load balancing, a proxy cache is also a good solution, provided it is viable for you. A trill to have it setup properly but it works as it frees the server from any php processing
We do perform some caching, but due to the content being so fluid and dynamic, it would be rather difficult to get a proxy cache to work properly under all circumstances. It is not a bad idea for just the one aspect of our site, but we have many other gadgets that really require us to have multiple balanced servers.
To get back on point though, I just think letting the server do the mail processing with applications such as sendmail/procmail etc is probably less resource intensive than having PHP socket connect to an SMTP server and perfrom the send itself. The mail programs are running as daemons so no interpreting is needed and if configured to batch send, it can reduce the amount of open connections as it can send multiple emails to the relay host with one connect.Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment