After benchmarking: couchrest performance bottleneck?
Reported by Ben | October 27th, 2008 @ 08:19 PM
First of all thanks for having built and released couchrest. I've been playing around with it, and I like that it doesn't stray far from couchdb semantics. (Models are looking exciting as well.)
I built a small test app, and noticed that I was only getting 8-10 req/s using couchdb as a backend. I then took my setup apart, and saw that my web framework by itself was getting around 200 req/s (ab -c 1 | 10), and my couchdb server was getting around 1000 req/s (ab -c 1 | 10) by itself. Once I added in a call to DB.documents or DB.get("_all_docs") my setup slowed down to 10 req/s.
I haven't had time to look into it, but I guess profiling a request would be the right way to see where couchrest spends most of its time.
I'm on OS X 10.4.11, Ruby 1.8.6, jchris-couchrest (0.9.12)
What are other people's performance numbers?
Thanks again. Ben.
Comments and changes to this ticket
-
J. Chris A. October 27th, 2008 @ 08:39 PM
wow ben, thanks for the attention to detail.
I've mostly been using CouchRest for shoveling data around, so I don't have req/response numbers like that, but that does seem slow.
How many docs do you have? how does couchrest perform for a medium complexity document GET?
-
Ben October 28th, 2008 @ 11:54 AM
Chris,
here's my writeup of the situation. Long story short, Net::HTTP appears to be the root cause of the slow-downs. This affects all current couchdb ruby libraries. Here's my writeup: http://ducktyped.com/2008/10/28/couchdb-ruby-libraries-are-fundamentally-flawed.
Ben
-
sco October 28th, 2008 @ 12:05 PM
Serendipitously, this ticket showed up in my news reader right next to an item about a faster Net::HTTP rewrite. Maybe it's a sign. FWIW:
-
Vinícius Manhães Teles November 11th, 2008 @ 12:15 PM
There's a useful analysis of the Net::HTTP problem at:
http://apocryph.org/more_indepth...
If CouchRest could rely on a different implementation like rfuzz or libcurl, I guess it's performance could be a lot better.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
"CouchDB, close to the metal." <a href="http://github.com/jchris/couchrest/tree/master">CouchRest</a> is a RESTful layer for accessing CouchDB, based off CouchDB's included Javascript reference client. CouchRest also includes helpers for running large queries etc. There is also a base class for ActiveRecord / Datamapper style ORM, called CouchRest::Model.