Request to increase initial CRC check latency to 5 seconds from 1 second

webhooks
account-activity

#1

Hi @KyleW and the rest of the twitter crew! I’d like to humbly request that the initial CRC check latency for the webhook API be increased from 1 second maximum to 5 seconds maximum.

One of the great advantages of webhooks is the ability to route requests to lambda functions, google cloud functions, azure web functions, or openwhisk style https fronted functions as a service. This drastically reduces operational overhead and code complexity and lets the developer focus on solving the business problems. It’s also a great way to get less experienced developers going with the Twitter API very quickly.

Each of these platforms suffers from a mild “cold-start” penalty. For instance my python3 lambda function running securely in my VPC has a cold-start time, the time it takes from when twitter pings the webhook until my function is invoked, of around 900ms. Subsequent invocations are instantaneous (<1ms). Unfortunately, my webhook responds around 1.8s which triggers the 1 second latency penalty.


{"errors":[{"code":214,"message":"High latency on CRC GET request. Your webhook should respond in less than 1 second."}]}

Now, this is not that hard to solve on the user’s side by creating a pre-warming call to the function. In fact that’s what I do right now… but I’m curious if that 1 second limit might be a bit too ambitious given the modern compute infrastructure we deal with.

If I have a server running at antartica amdusen station and I want to host a webhook there it seems like I may have more than 1 second of latency. What if I put a webhook on the international space station? A satellite? A remote region of Australia? Complex corporate infrastructure that routes my requests through numerous load balancers and firewalls? In all of these cases 5 seconds is enough time but 1 second is far too little.

Thanks for considering this!


#2

Thanks for the details @jrhunt I’ll pass this along to the product team as a suggestion. Can you elaborate on this request outside of the CRC check- is your application receiving/acknowledging Account Activity events under 1s or over 1s? Do you believe you’re missing events because of this latency or is this only related to the CRC check response requirement?


#4

My applications are fine on subsequent calls beyond the initial CRC check and are able to respond 99.99% of the time in <1 second - I do think having 5s max latency for all calls would be better though.