bson.deserializeObject taking up too much CPU time for seemingly simple query

40 views
Skip to first unread message

Stepan Shilin

unread,
Jun 5, 2018, 9:54:42 AM6/5/18
to node-mongodb-native
Hi, I have a collection of ~400 documents. And I have a REST method that for now just returns the result of the .find({}) query on this collection (i'm using mongoose btw). When I tried to benchmark this method with ~40 requests per second, I found that response times are horrible (~10s), and after I profiled the app, the flamegraph looked like this


Performance become tolerable when the query pulls like 20-30 objects, but if it gets over 100, the app just gets stuck on deserializing the results. Is it normal? Can . I do something about this?

Thanks in advance. 
Reply all
Reply to author
Forward
0 new messages