Thanks for that straight-up explanation, Chris. This has been a really interesting thread.<div><br></div><div>Seems pretty clear then, sticking your outbound email in a background job runner would sort it. Easy to miss when you're on a deadline - I'm actually really impressed you had time to do the jmeter-ing before launch! :)</div>
<div><br></div><div>Quite a few of the posts on the thread have mentioned unicorn and nginx, here's a write-up of how we're using them, together with bluepill for monitoring and resque for background jobs: <a href="http://www.devmull.net/articles/unicorn-resque-bluepill">http://www.devmull.net/articles/unicorn-resque-bluepill</a> - hope that's useful, would be cool to know if others have found better configs.</div>
<div><br></div><div>Cheers,</div><div>Steven<br>
<br><br><div class="gmail_quote">On Sun, Aug 7, 2011 at 5:02 PM, Chris Parsons <span dir="ltr"><<a href="mailto:chris.p@rsons.org">chris.p@rsons.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Hi Paul,<div><br><div><div>On 5 Aug 2011, at 09:33, Paul Robinson wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word"><div><div>It would be interesting to hear what caused the e-petitions site to go under. What cacheing was in use? Which tier gave in first? Was the load profile unexpected in that it was biased to some corner of the app that nobody thought people would be much interested in?</div>
</div></div></blockquote><blockquote type="cite"><div style="word-wrap:break-word"><div><br></div><div>1000/minute is less than 17 requests/second, and to my mind doesn't seem too absurd: almost 60ms per request on a single thread. A moderate server in terms of CPU with decent RAM, local MySQL instance and 4-6 Passenger threads should be able to handle that no problem at all, I think. So it would be interesting to hear which part of it failed first.</div>
</div></blockquote><div><br></div><div>Sorry for a bit of delay in responding to this thread. I'm planning to blog this soon, but here are the facts:</div><div><br></div><div>First up, the site didn't 'crash' as was reported: we had a few stuck rails processes and the load balancer is only a basic round robin, so you sometimes had to refresh a few times to get your request through. The site stayed up throughout if you were persistent.</div>
<div><br></div><div>The Rails processes got stuck waiting on SMTP connections for sending emails. As soon as the email sending load decreased, the site popped right back up. </div><div><br></div><div>The main lesson is not to trust your hosting environment's SMTP server to be responsive, and ensure that you send emails asynchronously right out of the gate rather than making the whole request dependent on it. We didn't quite get time to do this as part of main dev, but next time I'd proactively break this out of the critical path.</div>
<div><br></div><div>Re stress testing: We used JMeter to test the site load extensively, and pre-launch we were getting 50 req/second without much trouble. However, the one difference being that we were using dummy email addresses in our JMeter scripts, which the hosting environments SMTP service was discarding very quickly, and it could therefore take a much higher volume than in real life. Should've thought of that possibility, too :)</div>
<div><br></div><div>Hope that clears a few things up: happy to answer any other questions people have.</div><div><br></div><div>Thanks</div><div>Chris</div><div><br></div><div><br></div><br><blockquote type="cite">_______________________________________________<br>
Chat mailing list<br><a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</blockquote></div><font color="#888888"><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">--<br>
Chris Parsons<br><a href="mailto:chris.p@rsons.org" target="_blank">chris.p@rsons.org</a><br><a href="http://twitter.com/chrismdp" target="_blank">http://twitter.com/chrismdp</a><br><a href="http://pa.rsons.org" target="_blank">http://pa.rsons.org</a><br>
<br><br><br></span>
</div>
<br></font></div></div><br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br></div>