Here's what this closed model benchmark looks like: Queue times were always high because 4 connections were competing for 5 or less threads. Since you chose 4 VUs and the app is only 50% parallelizable, the server was 100% utilized for the entire duration of the test. Essentially, you went from a constant level of req/sec to 4 concurrent connections, each making a request immediately after receiving a response. You chose to switch to a closed traffic model in your version of the benchmark. The approach you took with the changes to my benchmark goes against a principle you said you wanted to follow here: not making decisions based on 100+% utilization. Ok, thanks for all your thoughts and additions to my benchmark I appreciate it. I've seen this one or twice, and there yes you can crank up the threads (or move to async).īut I don't think we should really be optimizing for this kind of situations, and 2 or 3 threads should still be plenty to keep a high enough utilization for apps having a few N+1 and a couple slow query issues.Īlso it's really just a default, even more, it's generated when you create the app, so it's really easy to edit. The only use case that would justify it would be an application whose main endpoint is essentially a proxy to another API. But even in applications with such issues, I've never really witnessed enough IOs to justify 5 threads. When you start optimizing a Rails application, the biggest problems you uncover are always query (or generally IO) related. That is true, and that's probably also why the popular belief that Ruby performance doesn't matter much because it's all IO anyway is so commonplace. The other thing to bear in mind is that the average rails app doesn't have as heavily tuned database queries. Yeah, I think we're pretty much in agreement for either 2 or 3. If you work back through Amdahl's Law, you can produce the following table, to give you an idea of the tradeoffs here even in a low-I/O app: Thread Count If I round the numbers a bit, Noah's benchmark result could be said to show something like the expected speedup given by Amdahl's Law for a 25%-wait-in-I/O application (in the formula though, 25% wait-on-io translates to 25% improvement in throughput w/5 threads). These apps receive a 30 to 65% improvement (respectively) in throughput with 5 threads, w/roughly a 25% increase in memory usage. But perhaps it is better to keep Rails multi-threaded by default, so that those bugs can occur and be seen and fixed often and early? What bugs would slip through is Rails became single-thread by default I chose the default of 5 in Puma based on the benefit for a Rails app with 25-50% time spent in I/O wait (based on my experience looking at 100+ Rails apps perf dashboards, this covers 80% or more of prod apps). Of course, the second thread is the most costly thread of all: now you're multi-threaded, with all the bugs that can cause. Amdahl's Law shows that modest throughput gains can be obtained even when small parts of the program can be done in parallel - for example, a Rails application that spends 30% of it's time waiting on I/O will have 18% higher throughput with 2 threads than with 1. Noah's result accords pretty well with Amdahl's Law. It still spends 25% of its time waiting on I/O. I would certainly consider Discourse a highly-optimized Rails app, maybe one of the most highly optimized in the world. One benchmark I recall of his showed that throughput on Discourse improved 25% when going from 1 to 5 threads. You can adjust the proportions and curves as needed to make it look more like the emoji you have in mind.Worked on this for many years (although his work stopped ~3 years ago after losing sponsorship). This should resemble a simplified thumbs-up emoji. Use the yellow Sharpie to color the rest of the hand, fingers, and thumb. It's that easy! Coloring: Use the red and orange Sharpie to create a shadow under and around the fingers. Then simply connect the threes with horizontal lines. That will be the nuckles of your four fingers. Just turn the paper and draw two connecting 3s. 3) At the top of the vertical line, draw a curved semi-circle that connects to the top of the thumb, creating the shape of the thumb's tip. 2) Draw a slightly curved vertical line extending from the middle of the horizontal line to represent the thumb itself. □️ 1) Using the orange Sharpie start with a horizontal line to represent the base of the thumb. How to Draw a Thumbs-up Emoji□ / Easy with 3 Sharpie Markers Materials: Grab your Yellow, Red, and Orange Sharpie.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |