I am using a spatial view for getting a group of objects by their coordinates. I started with an empty bucket which was growing over a time. In the beginning it had nice response times, but after few days, when bucket reached about 2 mln objects the spatial view started to behave really badly. From ~200 ms response time it unexpectedly went to around few seconds (it’s not visible in the plot because in my application I break the connection if response time is over 1.5s)
I have 3 nodes in my cluster and it still has 25% of RAM unused. The plot below shows mean couchbase spatial view REST API response times during first week of my application.
Here is my spatial view function
function (doc) { if (doc.geoLocation) { geojson = {}; geojson.type = "Point"; geojson.coordinates = [doc.geoLocation.lat, doc.geoLocation.lon]; emit( geojson, doc ); } }
Do you have any idea why the performance became so bad, and what can I do to improve it?