3
6 Comments

Does anyone else have the problem with measuring the speed and latency of internal API calls?

Trying to optimize on my front end latency problems and I think that the bottleneck is my internal API calls, wondering if there's any techniques or tools I can use for this?

  1. 2

    If the problem is that the payload is super large (like you mentioned below), I would confirm that first with the client-side devtools in Chrome/Firefox/<browser> using the "timing" tab:

    If the "waiting" line is the longest bit, then you know your backend is getting hung up some place. If "content download" is the longest, then your data payload is big and taking a long time to download.

    For debugging slowness in your backend, I would say add some instrumentation to generate a flame graph of the codepath(s) for a given route that you might be hitting. This will tell you exactly where slowness is and how long each function call is taking. This article has some rails-specific examples that look pretty good.

    1. 2

      Yo the flame graph is really great, thank you 🙏

  2. 1

    Use tools like
    Microsoft's Application Insights (excellent for .net, free to setup 500mb logs free, 2 eur/gb logs processed after that),
    Elastic's APM (bunch of integrations, free to host yourself )
    Datadog (cheaper than dynatrace)
    dynatrace
    Stackify

  3. 1

    Hello @hshidara, happy to help! I've developed HowFast (https://www.howfast.tech/) which has an APM (Application Performance Monitoring) feature, basically letting you know how long each of your endpoint takes. Ping me at [email protected] if you want to try it out :)

    As mentioned by the others, the Timings tab in the Developers Tool is your friend and will let you understand why a given request is slow, inside your browser (won't work for your users though).

  4. 2

    This comment was deleted 4 years ago.

    1. 1

      No caching, but I have 1 main payload on load, which isn't small, might need to break it up into other calls... Using rails and react.

      I'll try using Postman to isolate the problems, thank you!

    2. 1

      This comment was deleted 4 years ago.

Trending on Indie Hackers
How I grew a side project to 100k Unique Visitors in 7 days with 0 audience 49 comments Competing with Product Hunt: a month later 33 comments Why do you hate marketing? 29 comments My Top 20 Free Tools That I Use Everyday as an Indie Hacker 16 comments $15k revenues in <4 months as a solopreneur 14 comments Use Your Product 13 comments