Skip to content

Commit fb9ce25

Browse files
committed
explanation of http benchmark + resources
1 parent 13fa821 commit fb9ce25

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,20 @@ ab -c 5 -n 10 http://127.0.0.1:3000/widgets/http
2929
Concurrency Level: 5
3030
Time taken for tests: 2.740 seconds
3131
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/

0 commit comments

Comments
 (0)