rarible/protocol

Multichain API order of magnitude slower

Closed this issue · 6 comments

The Multichain API performs significantly slower than the Ethereum API. We have made an example that compares the performance of both APIs.

We have attached an example. We pull NFTs by creators or by a collection. Our benchmark shows that the Ethereum API returns 1000 NFTs per sec. The Multichain Api take between 4-6 seconds per 1000 NFTs.

We have seen these results in the following APIs: NFTs by owner, NFTs by creator, and NFTs by collection.

Here is the example and the results.
Note: each requests is 1000 NFTs.

Screen Shot 2022-04-01 at 1 50 16 PM
Screen Shot 2022-04-01 at 1 31 20 PM

Just a note when testing performance. If the endpoint supported a HEAD request, we could separate the DNS/Routing/Load balancer/TCP connection setup time from the actual API response time. (Basically http client opens a tcp connection for the HEAD request first. Then you start your timers for the actual API call within the same TCP connection.) This might be negligible, or there may be something in the path causing an issue.

I am encouraging the above so the status page, can automatically check the network component of the API calls. We already had an outage this week which the most basic of monitoring should have caught.

Hey @bobwith2bees & @Geo25rey

We have taken in your reports (&suggestions)and are working on a fix.

Hey there @Geo25rey @vaultec81 ,

We have pushed a patch that should improve the performance. Could you test on your end and let us know your findings?

@eduardstal

The Multichain API performance seems to have improved, but it's also very in consistent.

Some test results:

Took 2407ms to complete with the Ethereum API
Took 5955ms to complete with the Multichain API

Took 1243ms to complete with the Ethereum API
Took 2321ms to complete with the Multichain API

Took 1893ms to complete with the Ethereum API
Took 2074ms to complete with the Multichain API

FYI:
There appears to be inconsistent latency even with ping using the Multichain endpoint (staging).

❯ ping -c 20 api-staging.rarible.org
PING api-staging.rarible.org (104.26.13.19): 56 data bytes
64 bytes from 104.26.13.19: icmp_seq=0 ttl=51 time=56.582 ms
64 bytes from 104.26.13.19: icmp_seq=1 ttl=51 time=46.387 ms
64 bytes from 104.26.13.19: icmp_seq=2 ttl=51 time=183.333 ms
64 bytes from 104.26.13.19: icmp_seq=3 ttl=51 time=53.980 ms
64 bytes from 104.26.13.19: icmp_seq=4 ttl=51 time=53.136 ms
64 bytes from 104.26.13.19: icmp_seq=5 ttl=51 time=51.880 ms
64 bytes from 104.26.13.19: icmp_seq=6 ttl=51 time=52.308 ms
64 bytes from 104.26.13.19: icmp_seq=7 ttl=51 time=50.422 ms
64 bytes from 104.26.13.19: icmp_seq=8 ttl=51 time=54.805 ms
64 bytes from 104.26.13.19: icmp_seq=9 ttl=51 time=50.531 ms
64 bytes from 104.26.13.19: icmp_seq=10 ttl=51 time=62.115 ms
64 bytes from 104.26.13.19: icmp_seq=11 ttl=51 time=56.399 ms
64 bytes from 104.26.13.19: icmp_seq=12 ttl=51 time=56.274 ms
64 bytes from 104.26.13.19: icmp_seq=13 ttl=51 time=45.239 ms
64 bytes from 104.26.13.19: icmp_seq=14 ttl=51 time=501.614 ms
64 bytes from 104.26.13.19: icmp_seq=15 ttl=51 time=78.880 ms
64 bytes from 104.26.13.19: icmp_seq=16 ttl=51 time=52.608 ms
64 bytes from 104.26.13.19: icmp_seq=17 ttl=51 time=57.794 ms
64 bytes from 104.26.13.19: icmp_seq=18 ttl=51 time=50.577 ms
64 bytes from 104.26.13.19: icmp_seq=19 ttl=51 time=54.212 ms

--- api-staging.rarible.org ping statistics ---
20 packets transmitted, 20 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 45.239/83.454/501.614/100.158 ms

Multichain API latency was improved greatly

  • Closing this issue as stale

Feel free to reopen if any help needed or you experience this issue