Around a week ago we changed the ASN lookup code on both our v1 and v2 API endpoints with the goal of speeding up these queries.
Due to the way ASN data has to be computed before it can be searched effectively it has always been resource intensive to perform ASN data lookups but with our new code we're now pre-processing all ASN data so it's in its most easily searched representation before any queries are made by our customers.
We've also changed how we're caching ASN data meaning repeated lookups even hours apart will have a much higher cache hit rate. All of our API cacheing functions are custom made and highly tuned utilising system memory.
The result of all this work has been significantly faster ASN results, we're now seeing around 80% of our ASN queries answered in under 55ms when previously 99% of ASN queries took over 300ms. We're also seeing a 30% query cache hit rate for our new level-1 ASN cache (IP to ASN) and 70% cache hit rates for our level-2 ASN cache (ASN to company and country).
Only around 4% of the queries we process every day utilise the ASN flag and that's likely due to either the added latency it creates or the customer not needing to perform ASN lookups. So whilst this is a small area of our business it was important for us to improve its performance which we have now done.
Another added benefit of this change is lower CPU utilisation on our cluster nodes which will allow us to answer all queries even faster than before and increase the volume of queries each node can process.
Thanks for reading and have a great day!