So I am running Sinatra app in a multi-threaded environment. It seems the Ruby couchbase library isn't doing well.
I tried using both Rainbows and Puma, and they both yielded the same result.
I get a lot of these errors
NoMethodError - undefined method `success?' for nil:NilClass:
/projects/nm/.bundle/ruby/2.2.0/gems/couchbase-1.3.11/lib/couchbase/view.rb:494:in `fetch_sync'
/projects/nm/.bundle/ruby/2.2.0/gems/couchbase-1.3.11/lib/couchbase/view.rb:378:in `fetch'
/projects/nm/.bundle/ruby/2.2.0/gems/couchbase-1.3.11/lib/couchbase/view.rb:200:in `each'
/projects/nm/app/models/user.rb:227:in `map'
I tested this by running a puma server, with -t 8:32.
Then using ApacheBench:
ab -c 4 -n 100 "
http://localhost:9091/user/dosomesearch"
This test is okay and doesn't produce errors:
ab -n 100 "
http://localhost:9091/user/dosomesearch"
It seems that when there are multiple concurrent connections, the library isn't handling it well. Is there a flag I need to enable for this?