Q: How can I fix delays in Terra payloads?

BasicScorpion1 month ago

When I authenticate a user or make a HTTP request with to_webhook there is a significant delay, however if I make a HTTP request without to_webhook, the request takes less than 1 second. Wondering if anyone has experienced this issue?

terra

Matthewadmin1 month ago

Hey there

To diagnose this issue, please go onto the dashboard and use the debug tools by navigating to [Dashboard > Tools > Debug > Event Log] and identifying the payload that is affected. Then click the arrow on the right to pullup more details about the event and look at the response time. If you notice that the response time is very large (>2000ms), the issue is most likely caused by your server taking very long to respond to the post request we make to your webhook.


BasicScorpion1 month ago

Some events do report very large response times 5000-12000ms, what could be causing this and how can we fix this?


terra

Matthewadmin1 month ago

Slow server responses could caused by server-overload, if your server is unable to handle the number of requests Terra is sending, if your server is unable to handle multiple requests concurrently or does not have sufficient resources to manager large amounts of traffic, you should consider scaling your ingestion service (allocating more resources).

Or, there may be long synchronous queries being run on your webhook endpoint (to your database or other) that is stalling the response. Look through any queries you are making and optimise your queries or execute them asynchronously.