DEV Community

Snipe 39
Snipe 39

Posted on

Axios latency

Hi all,

I have a big problem with Axios request. I am using this component to communicate with an external API (100+ requests per second). More than 98% of the requests are done within 20 milliseconds. Some requests take several seconds (not a problem of the API side) and I don't know why. Below is a piece of code:

Image description

Sometimes the time difference between t2 and t is too huge and everything slows down. Can you please help me.

Thank you.

Top comments (1)

Collapse
 
framemuse profile image
Valery Zinchenko
  1. How do you validate this is not API-related problem?
  2. How do you validate this is not your server problem?
  3. What is your axios config? Maybe you have request/response interceptor that takes too long.
  4. Can you tell if the request or the response takes longer time?