curl -w prints where the time went
A slow request is DNS, connect, TLS, server think time or transfer, and -w splits them.
curl -o /dev/null -s -w 'dns %{time_namelookup} connect %{time_connect} tls %{time_appconnect} ttfb %{time_starttransfer} total %{time_total}\n' https://example.com/apiIf ttfb is most of the total, it is the server. If tls is, it is the handshake, and keep-alive would help.
shellhttp