ruby on rails - Why is sending an email from a server so time-consuming? -
on localhost
, sending confirmation email devise
gem via gmail takes, on average, 5 seconds observed ceiling of 10 seconds. after doing research, appears norm , thus, recommended have server handle email delivery asynchronously. part of process causing delays? using browser log in gmail , send email done in shorter time 10 seconds. server waiting kind of response sent email received?
i uncertainty log gmail , send message quicker maybe. delay caused tcp connection overhead , ssl negotiation, smtp authentication. there artificial delay introduced in terms of anti spam measures or smtp banner delays. need transfer message , wait server ok , tear connection downwards before deliver method returns. run own queuing mail service server on web hosts ssl, doesn't auth, etc , way faster. either smart host via upstream or google. homecoming command rails app faster , allow mail service server handle queuing, off, , opposed having rails app wait on submission.
ruby-on-rails email ruby-on-rails-4 asynchronous devise
No comments:
Post a Comment