ordhook icon indicating copy to clipboard operation
ordhook copied to clipboard

524 error and timeout when hitting the attached ordinals API URL

Open timstackblock opened this issue 2 years ago • 1 comments

Describe the bug go to this URL https://api.stg.hiro.so/ordinals/v1/inscriptions?from_genesis_block_height=799988&mime_type=text%2Fplain&limit=60&offset=0&order=asc&order_by=genesis_block_height

You will get an infinite spinner and eventually a 524 error and a timeout, I pulled this URL out of the grafana logs when sourcing data for the load test.

Screen Shot 2023-08-21 at 12 31 53 PM Screen Shot 2023-08-21 at 12 25 49 PM

timstackblock avatar Aug 21 '23 16:08 timstackblock

After investigating, I've found that this particular query is very slow because it is trying to count results with several filters at the same time which don't fall inside of the count caches we already have. Caching counts for these specific filters would be very expensive (storage-wise) because we'd need to save counts for all mime types per block.

One option we could explore in these cases is returning count estimates instead of a precise number.

rafaelcr avatar Sep 21 '23 17:09 rafaelcr