开发者

Rails 3.0 intermittent Connection timed out, execution expired errors

We're on four Amazon EC2 instances (one load balancer, one db, and two app) and are constantly getting random timeouts. We get at least one a day, sometimes more. Here are some examples:

Errno::ETIMEDOUT: Connection timed out - connect(2)
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/smtp.rb:546:in `initialize'

and

Timeout::Error: execution expired
[GEM_ROOT]/gems/activemodel-3.0.9/lib/active_model/attribute_method开发者_如何学Cs.rb:354:in `match'

I'm not sure how to debug these as they are not related to application code or server load. CPU usage usually hovers below 10% with the biggest spike going up to 60%. The spikes are most likely due to running backups and do not correspond with the times of the timeout errors.

How can these types of errors be tracked down?


The first timeout looks like a legit connection timeout sending mail via SMTP. Are you hosting your own SMTP server or using a service?

Looks like sendgrid has been experiencing delays/timeouts the last couple of days:

We're currently seeing lots of volume in our queues and emails may be delayed for a short period. Stay tuned for updates. #status

Fix for SMTP Service Timeout/Fails

Setup a local mail relay that will hold mail and re-send if there are failures like this. We use a local Postfix relay in production for just this problem (so ActiveMailer uses sendmail to Postfix, which queues up mail and delivers via SMTP relay to Sendgrid).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜