The efficiency of mongodb concurrent query is very low.

personal blog A personal blog written by has a concurrency problem: using Aliyun"s pts to test concurrency, it is found that when the number of concurrency reaches 8 (which is negligible), the database query is particularly slow (there is very little data in the database)? I would like to ask from which aspect should I think about and solve this problem, and how to optimize it? At present, it can be determined that the problem is caused by the database.
the connection code is as follows:

mongoose.connect("mongodb://***.***.***.***:27017/blog",{useMongoClient:true,
    user:"**************",
    pass:"********************"
},()=>{
   http.createServer((req,res)=>{
       res.writeHead(302, {"Location": "https://www.hejuncai.com" + req.url});
    res.end();
   }).listen(80);
   https.createServer(options,app).listen(443);
});

the query code is as follows

Content.find({//
        lassification:getArticleID ||  {"$ne":null, $exists: true }
      },(err,doc1)=>{                                      
                if(err){
                    console.error(err);
                    return false;
                }
                res.render("main/index",{      
                    content:doc1 || "",//
                });
            }).sort({_id:-1}).limit(10);




Mar.18,2021

it is recommended to change the development language

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beb6ce-307c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beb6ce-307c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?