Nodejs interface is blocked and slow to respond

nodejs should be able to meet high concurrency by using asynchronous callback.
but when using postman for interface stress testing, it is found that
the next interface requests only after the previous interface gets a response, and the response time is more than one second

.

is it because the nodejs connection database does not use connection pooling?
is it because I"m not using redis?
or is it because there"s something wrong with my test method?

var express = require("express");
var fs = require("fs");
var path = require("path");
var crypto = require("crypto"); //
var router = express.Router();
var MongoClient = require("mongodb").MongoClient;
var ObjectID = require("mongodb").ObjectID;
var url = "mongodb://localhost:27017/books";
// 
var buf = new Buffer.alloc(2048);

// app
router.post("/enroll", function(req, res){
    var data = {
        userName: req.body.userName,
        sex: req.body.sex,
        userPhone: req.body.userPhone,
        userEmail: req.body.userEmail,
        password: req.body.password,
        status: 1
    }
    for(var k in data){
        if(!data[k]){
            res.json({code:4, content:""});
            return false
        }
    }
    MongoClient.connect(url, { useNewUrlParser: true }, function(err, db) {
        if (err) throw err;
        var dbo = db.db("books");
        dbo.collection("user").find({userPhone: data.userPhone}).count(function(err, num){
            if(err) throw err;
            if(num == 0){
                // 
                var pwObj = encrypt(data.password);
                data.password = pwObj.pw;
                data.key = pwObj.key;
                dbo.collection("user").insertOne(data, function(err, result) {
                    if (err){
                        res.json({code:4, content: ""});
                        throw err;
                    }
                    res.json({code:1, content: ""});
                })
            }else{
                res.json({code:2, content: ""})
            }
            db.close();
        });
    });
});

// APP
router.post("/login", function(req, res){
    var userPhone = req.body.userPhone;
    var password = req.body.password;
    console.log(userPhone);
    console.log(password);
    if(userPhone && password){
        MongoClient.connect(url, { useNewUrlParser: true }, function(err, db) {
            if (err) throw err;
            var dbo = db.db("books");
            dbo.collection("user").find({userPhone: userPhone}).toArray(function(err, resArr) {
                if (err) throw err;
                if(resArr.length>0){
                    password = password + resArr[0].key;
                    var md5 = crypto.createHash("md5");
                    var r = md5.update(password).digest("hex");
                    if(r == resArr[0].password){
                        res.json({code: 1, content: resArr[0]._id});
                    }else{
                        res.json({code: 2, content: ""});
                    }
                }else{
                    res.json({code: 2, content: ""});
                }
                db.close();
            });
        });
    }else{
        res.json({code: 4, content: ""});
    }
});

Apr.29,2022

is that there is something wrong with my test method. The 50 items tested by the company's test engineers are completed in 4 seconds, but each request takes more than a second. After removing the code that operates the database, it only takes 200ms, indicating that the operation of the database needs to be optimized. It should be cached by Redis.

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-1c0a722-32a09.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-1c0a722-32a09.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?