File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,20 @@ ab -c 5 -n 10 http://127.0.0.1:3000/widgets/http
29
29
Concurrency Level: 5
30
30
Time taken for tests: 2.740 seconds
31
31
Complete requests: 10
32
+
33
+ Scenario:
34
+
35
+ * AB opens 5 concurrent requests (10 total)
36
+ * Each request to /widgets/http opens an async HTTP request to /widgets - aka, we ourselves spawn another 5 requests
37
+ * Because the fiber pool is set to 10, it means we can process all 5 requests within ~ 1s (each mysql req takes 1s)
38
+ * 10 requests finish in ~ 2s
39
+
40
+ So, keep in mind that the size of 'database pool' is basically your concurrency throttle. In example above, we spawn
41
+ 10 requests, which open another 10 internally, so in total we process 20 req's in ~ 2s on a single thing server. Just as expected.
42
+
43
+ Resources:
44
+
45
+ * http://www.slideshare.net/igrigorik/no-callbacks-no-threads-railsconf-2010
46
+ * http://www.igvita.com/2010/06/07/rails-performance-needs-an-overhaul/
47
+ * http://www.igvita.com/2010/04/15/non-blocking-activerecord-rails/
48
+ * http://www.igvita.com/2010/03/22/untangling-evented-code-with-ruby-fibers/
You can’t perform that action at this time.
0 commit comments