I usage :
Nuxt js v 2.10.2
expressjs v 4.17.1
NodeJS v13.9.0
In the production version, I found unexpected behavior; any API request works up to 300 ms. But sometimes (one of 30 of any requests) takes 10-15 seconds. I thought there was not enough memory, but there were no errors at all. Any ideas ?
I checked the time with such a function :
const app = express()
app.use('/',function(req,res,next){
let date1 = +(new Date())
res.on('finish',()=>{
let time = +(new Date())-date1
if(time>1000)console.error( "Any text")}
})
next()
})
.........
Can you provide a minimal reproduction that demonstrates the behavior? Without seeing your code I can't tell what is happening that could cause this.
Most helpful comment
Can you provide a minimal reproduction that demonstrates the behavior? Without seeing your code I can't tell what is happening that could cause this.