I am using artillery to send different rate of request to an nodejs
API that makes an axios
post request, and the response time seems to be increasing as time goes by.
e.g. when sending 10 req/sec to the API, the response time are around 100-300ms for the axios
post request, however after maybe an hour, as the request continues to call the API, the response time for the axios
slowly climbs to several seconds.
another e.g. when sending at 30 req/sec, the response time also starts around 100-300ms, then immediately, the response time climbs to 1-3 seconds, and after a few more seconds, response time becomes 1min+.
My API have this axios
request:
const httpsAgent = new https.Agent({ keepAlive: true })
const axiosRetry = require('axios-retry')
const axios = require('axios')
const method = async (URL, request, headers) => {
const now = Date.now()
console.time('axios call ' + now)
axiosRetry(axios, {
retries: 3,
retryDelay: () => {
return 5000
},
retryCondition: (error) => {
return error.response.status === 503;
}
})
await axios.post(URL, request, {
headers,
timeout: 60000,
httpsAgent
})
console.timeEnd('axios call ' + now)
}
I have tried using artillery to call the axios's
URL directly and the response time seems stable around 110ms, despite calling at 30 req/sec for about 1 hour duration.
hence I think I'm narrowing down to this axios
request.