12 ms·
Well, this certainly calls into question their competence. They're a PaaS company that doesn't understand or measure their load balancing performance. If you
by chubot 14y ago
Well, this certainly calls into question their competence. They're a PaaS company that doesn't understand or measure their load balancing performance.
If you are a PaaS company, and you only have 5 metrics you can record, then 99% percentile latency across all apps should be one of them.
On another note: why is Rails single-threaded??? That seems unbelievable. So if you have a 2 second database query, your Rails process does nothing else for that 2 seconds? I mean people complain about the GIL in Python, which actually has reasons behind it, but this is just crazy.
- trustfundbaby 14y agoOn another note: why is Rails single-threaded??? That seems unbelievable. So if you have a 2 second database query, your Rails process does nothing else for that 2 seconds? --------------------- Thats not what happens, Rails does not block on IO, it will switch to another thread/process another request while it waits for IO to complete in the first request. http://yehudakatz.com/2010/08/14/threads-in-ruby-enough-already/ http://yehudakatz.com/2010/08/14/threads-in-ruby-enough-alre...
- chubot 14y agoI think you only read the beginning of that article, not the end. What the article seems to imply is that you have to use a web server that spins off Rails in multiple processes. Ruby does concurrent I/O (obviously) but Rails itself does not appear to do it by default, causing the problems discussed here. "Rails, in fact, does not yet reliably support concurrent request handling. This leaves Rails developers unable to leverage the additional concurrency capabilities offered by the Cedar stack, unless they move to a concurrent web server like Puma or Unicorn." "Most obviously, early versions of Rails were not threadsafe. As a result, all Rails users were operating with a mutex around the entire request, forcing Rails to behave like the first “Imagined” diagram above. Annoyingly, Mongrel, the most common Ruby web server for a few years, hardcoded this mutex into its Rails handler. As a result, if you spun up Rails in “threadsafe” mode a year ago using Mongrel, you would have gotten exactly zero concurrency."
- charliesome 14y agoRails 3 is single threaded by default, but it can be made multi-threaded with config.threadsafe!. Rails 4 is multi-threaded by default.
- inopinatus 14y agoAh, no. Being single-threaded isn't the same as blocking on IO wait, because threads can switch tasks. This is the essence of the classic Unix select(2) loop and most of the higher-performing variants; poll(2), kqueues etc.