Created
November 15, 2011 18:19
-
-
Save adamlwatson/1367854 to your computer and use it in GitHub Desktop.
Testing throughput bottlenecks in Goliath from Mongoid gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0. gem install goliath (should be v0.9.4 as of writing this) | |
1. gem install mongoid (should be v2.3.3 as of writing this) | |
2. create and save test.rb file (see below) | |
3. % ruby test.rb -sv | |
4. % ab -n500 -c10 http://localhost:9000/status | |
5. note the req/s results (somewhere around 80-90 req/s on my machine) | |
6. edit the test.rb file, remove the 'require mongoid' line | |
7. repeat steps 3 and 4. | |
8. note the req/s results (somewhere aaround 550 req/s on my machine) | |
Conclusion: Mongoid is patching something in its initialization that is causing severe performance bottlenecks in Goliath. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$:<< '../lib' << 'lib' | |
require 'goliath' | |
require 'mongoid' | |
class HelloWorld < Goliath::API | |
use Goliath::Rack::Heartbeat | |
def response(env) | |
[200, {}, ""] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(the short version of what I'm puzzling through is how do I know that MongoDB calls are really async... that's where this all started)