Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

explanation of http benchmark + resources

  • Loading branch information...
commit fb9ce25e63a7c1f7c68cb9602dee5bdcfc6b02dc 1 parent 13fa821
@igrigorik authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 README.md
View
17 README.md
@@ -29,3 +29,20 @@ ab -c 5 -n 10 http://127.0.0.1:3000/widgets/http
Concurrency Level: 5
Time taken for tests: 2.740 seconds
Complete requests: 10
+
+Scenario:
+
+ * AB opens 5 concurrent requests (10 total)
+ * Each request to /widgets/http opens an async HTTP request to /widgets - aka, we ourselves spawn another 5 requests
+ * Because the fiber pool is set to 10, it means we can process all 5 requests within ~1s (each mysql req takes 1s)
+ * 10 requests finish in ~2s
+
+So, keep in mind that the size of 'database pool' is basically your concurrency throttle. In example above, we spawn
+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.
+
+Resources:
+
+ * http://www.slideshare.net/igrigorik/no-callbacks-no-threads-railsconf-2010
+ * http://www.igvita.com/2010/06/07/rails-performance-needs-an-overhaul/
+ * http://www.igvita.com/2010/04/15/non-blocking-activerecord-rails/
+ * http://www.igvita.com/2010/03/22/untangling-evented-code-with-ruby-fibers/
Please sign in to comment.
Something went wrong with that request. Please try again.