Hello!
I have my PouchDB in nodejs configured to either use LevelDB or CouchDB (depending on deployment scenarios).
When I stress test my app with LevelDB, everything works fine. If I use CouchDB as backend, I get EADDRINUSE errors.
Apparently, this is because the client TCP connection requires a unique port (epheremal) and this port does not get released until some time out (see also
http://blog.gluwer.com/2014/03/story-of-eaddrinuse-and-econnreset-errors...)As a solution, I read that I need to apply a pool and set the maxConnections for the require node module. I did this (like) this:
var db=pouchdb({name:
"http://127.0.0.1:5984/db", ajax: { pool: { maxSockets: 500 } });
But this did not help. I still get errors when I put a lot of documents in it (simulating client behaviour - bulkDocs is not an option).
Could someone provide an example how this is correctly set up? I did look at the common errors, and the various API calls, but the description was always pretty generic - the ajax parameters are passed to require npm module (except cache)
Markus