xDai Stable Chain xDai Stable Chain BlockScout BlockScout TokenBridge TokenBridge

Ethereum Mainnet Blockscout API stress testing

Recently, the POA team launched first distributed BlockScout installation. The ETH Mainnet BlockScout application were separated into two different services. First serves the web requests, and the second one is dedicated for API requests only. To support the increasing workload the DB read replica was also established.
Since each of the BlockScout API requests is the read request it was highly reasonable to use the separate DB instance which is replicated from the main DB and used for read requests only. It can also be used for disaster recovery purpose. The separate BlockScout engine uses the read-only database in order to proceed the API read requests. As such, it will be easy to handle the continuously increasing API workload by increasing the number of DB read replicas.

Here is the detailed results of performed API stress testing:

Table 1 - Results before splitting

Label # Samples Average Min Max Std. Dev. Error % Throughput Received KB/sec Sent KB/sec Avg. Bytes
eth_get_balance API 3000 2638 448 33771 2410.08 7.67% 8.62022 7.04 4.2 836.5
balancemulti API 3000 1590 120 33816 2255.63 3.37% 8.63337 7.23 5.14 857.7
getlogs API 3000 2135 118 41228 4159.28 3.00% 8.63729 33.71 7.2 3996
eth_block_number API 3000 1680 110 32002 2160.8 3.23% 8.66318 5.85 4.41 691.6
ethprice API 3000 1560 110 30348 2152.55 2.07% 8.68712 6.46 4.41 761.3
ethsupply API 3000 1541 109 31743 2129.75 2.23% 8.69127 5.83 4.41 686.3
tokensupply API 3000 1423 111 30001 2034.78 2.10% 8.69724 5.77 4.93 679.6
getstatus API 3000 1435 111 32013 2220.97 1.83% 8.70065 5.76 5.1 678.3
gettxreceiptstatus API 3000 1449 111 32688 1942.15 1.60% 8.77244 5.58 5.23 651.3
gettxinfo API 3000 1764 115 37342 2923.95 1.60% 8.8397 12.89 5.2 1493.4
getsourcecode API 3000 5672 230 57922 8542.87 8.67% 8.91639 193.92 4.69 22270.3
getabi API 3000 5076 117 79961 7664.85 12.27% 9.05324 67.3 4.52 7612.5
listcontracts API 3000 9558 425 81065 11320.72 16.47% 9.08166 356.85 3.99 40237.1
listaccounts API 3000 3005 154 46192 3967.08 11.60% 9.19817 15.36 4.26 1710
tokenlist API 3000 1429 116 34935 2731.77 4.87% 9.28178 11.94 5.04 1317.7
tokenbalance API 3000 907 111 34161 2163.49 3.23% 9.29647 6.25 5.68 688.9
tokentx API 3000 54232 2589 163714 21733.75 41.27% 9.03756 3074.81 3.02 348391.4
txlistinternal API 3000 2461 446 43025 3313.07 8.73% 9.30186 16.13 5.08 1776.2
txlist API 3000 1910 119 58399 4044.34 4.73% 9.31191 30.88 5.04 3395.4
Get Token API 3000 1035 111 31243 2012.88 3.63% 9.46865 8.25 5.26 892
Balance API 3000 707 115 33403 1728.14 2.43% 9.46892 6.34 5.26 686
TOTAL 63000 4915 109 163714 12901.08 6.98% 172.9966 3542.23 93.88 20967.1

Table 2 - Results after splitting

Label # Samples Average Min Max Std. Dev. Error % Throughput Received KB/sec Sent KB/sec Avg. Bytes
eth_get_balance API 3000 2045 242 18808 1570.46 3.80% 22.17 33.09 10.06 1528.6
balancemulti API 3000 1622 257 12312 1157.38 5.47% 22.18886 33.37 11.54 1540.1
getlogs API 3000 1875 183 13603 1518.23 4.17% 22.1587 43.35 16.9 2003.3
eth_block_number API 3000 1590 143 13512 1499.76 0.23% 22.25321 30.03 9.56 1381.7
ethprice API 3000 1595 144 12598 1471.9 0.27% 22.37053 33 9.43 1510.6
ethsupply API 3000 1670 146 13862 1532.41 0.27% 22.40428 31.89 9.47 1457.7
tokensupply API 3000 1741 145 15025 1535.93 2.73% 22.47141 32.23 10.84 1468.7
getstatus API 3000 1760 150 12513 1552.6 2.67% 22.56793 32.48 11.29 1473.9
gettxreceiptstatus API 3000 1780 152 14152 1580.27 3.17% 22.85854 32.3 11.66 1446.7
gettxinfo API 3000 1840 165 10705 1469.61 7.63% 22.98217 40.31 11.52 1796.3
getsourcecode API 3000 2022 166 23601 1699.03 8.20% 23.27259 119.18 11.15 5244
getabi API 3000 1790 156 26056 1568.69 8.57% 23.44831 47.5 11.08 2074.4
listcontracts API 3000 1929 168 30137 1617.16 9.07% 23.8343 108.71 10.25 4670.6
listaccounts API 3000 3325 205 18173 1980.25 37.03% 24.35915 38.79 10.43 1630.6
tokenlist API 3000 2054 150 21539 1848.41 8.33% 24.81841 40.87 11.77 1686.1
tokenbalance API 3000 1354 148 13398 1491.56 9.80% 25.18849 34.01 13.47 1382.6
tokentx API 3000 4457 269 44684 2861.13 18.03% 26.4903 2581.87 12.49 99804.1
txlistinternal API 3000 1857 147 18271 1929.65 6.53% 26.52027 45.77 13.28 1767.3
txlist API 3000 1194 158 16608 1362.58 10.50% 26.88847 58.88 12.69 2242.5
Get Token API 3000 1076 143 15523 1361.49 3.97% 27.40377 42.54 13.13 1589.6
Balance API 3000 1270 147 14558 1453.91 7.23% 27.6929 39.61 13.09 1464.5
TOTAL 63000 1897 143 44684 1805.52 7.51% 431.92398 2795.21 210.2 6626.9

Table 3 - Rate of increase (each value showed in %)

Label # Samples Average Min Max Std. Dev. Error % Throughput Received KB/sec Sent KB/sec Avg. Bytes
eth_get_balance API 0.0 -22.5 -46.0 -44.3 -34.8 -50.4 157.2 370.0 139.5 82.7
balancemulti API 0.0 2.0 114.2 -63.6 -48.7 62.4 157.0 361.5 124.5 79.6
getlogs API 0.0 -12.2 55.1 -67.0 -63.5 38.9 156.5 28.6 134.7 -49.9
eth_block_number API 0.0 -5.4 30.0 -57.8 -30.6 -92.8 156.9 413.3 116.8 99.8
ethprice API 0.0 2.2 30.9 -58.5 -31.6 -87.1 157.5 410.8 113.8 98.4
ethsupply API 0.0 8.4 33.9 -56.3 -28.0 -88.0 157.8 447.0 114.7 112.4
tokensupply API 0.0 22.3 30.6 -49.9 -24.5 30.1 158.4 458.6 119.9 116.1
getstatus API 0.0 22.6 35.1 -60.9 -30.1 45.5 159.4 463.9 121.4 117.3
gettxreceiptstatus API 0.0 22.8 36.9 -56.7 -18.6 97.9 160.6 478.9 122.9 122.1
gettxinfo API 0.0 4.3 43.5 -71.3 -49.7 377.1 160.0 212.7 121.5 20.3
getsourcecode API 0.0 -64.4 -27.8 -59.3 -80.1 -5.4 161.0 -38.5 137.7 -76.5
getabi API 0.0 -64.7 33.3 -67.4 -79.5 -30.2 159.0 -29.4 145.1 -72.8
listcontracts API 0.0 -79.8 -60.5 -62.8 -85.7 -44.9 162.4 -69.5 156.9 -88.4
listaccounts API 0.0 10.6 33.1 -60.7 -50.1 219.3 164.8 152.5 144.8 -4.6
tokenlist API 0.0 43.7 29.3 -38.3 -32.3 71.2 167.4 242.3 133.5 28.0
tokenbalance API 0.0 49.3 33.3 -60.8 -31.1 203.1 170.9 444.2 137.1 100.7
tokentx API 0.0 -91.8 -89.6 -72.7 -86.8 -56.3 193.1 -16.0 313.6 -71.4
txlistinternal API 0.0 -24.5 -67.0 -57.5 -41.8 -25.2 185.1 183.8 161.4 -0.5
txlist API 0.0 -37.5 32.8 -71.6 -66.3 121.8 188.8 90.7 151.8 -34.0
Get Token API 0.0 4.0 28.8 -50.3 -32.4 9.2 189.4 415.6 149.6 78.2
Balance API 0.0 79.6 27.8 -56.4 -15.9 197.3 192.5 524.8 148.9 113.5
TOTAL 0.0 -61.4 31.2 -72.7 -86.0 7.5 149.7 -21.1 123.9 -68.4

As shown in the tables above - the API throughput was increased for 150% decreasing the response time and keeping approximately the same error rate. Also, the average BlockScout web requests load were decreased.

1 Like