spesmilo / electrumx

Alternative implementation of spesmilo/electrum-server
MIT License
429 stars 343 forks source link

Unable to respond during synchronization of mempool? #227

Closed zhiying8710 closed 11 months ago

zhiying8710 commented 12 months ago
ERROR:MemPool:43 txs dropped
INFO:MemPool:126,732 txs 50.90 MB touching 246,490 addresses
INFO:MemPool:compact fee histogram: [(31.3, 30215), (20.9, 33258), (15.6, 37036), (14.5, 44580), (13.8, 52917), (13.0, 51667), (11.8, 59199), (9.6, 63035), (8.3, 95529), (7.0, 110079), (6.1, 93299), (6.0, 221479), (5.8, 126941), (5.7, 740512), (5.5, 212413), (5.4, 373181), (5.3, 255351), (5.2, 336167), (5.1, 109438), (5.0, 355851), (4.8, 323726), (4.1, 207200), (4.0, 1001198), (3.9, 1462290), (3.8, 652871), (3.7, 697597), (3.6, 952416), (3.3, 563040), (3.0, 947873), (2.6, 526963), (2.3, 70453), (2.2, 1124480), (2.1, 1776080), (2.0, 1234166), (1.6, 887826), (1.3, 856256)]
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['deb01dc841079b6ab7c88f04158afddd09c6b210675f06adc9d5e64e28cc2d5d']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['1ca0cf1e87a7a457abaa2baa8b458320f32dc5c2f78886675608d844b45f2111']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['972d8291ee593dfa33746e340d546096a0799fb098bd00afd7c0d8b661566c14']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['352ef873c902ceea73e41ccabbc063f8717820bc50e654d4155cc2c92676c264']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['deb01dc841079b6ab7c88f04158afddd09c6b210675f06adc9d5e64e28cc2d5d']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['1ca0cf1e87a7a457abaa2baa8b458320f32dc5c2f78886675608d844b45f2111']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['04c4bb1ff43481169d2bb33ac2dcc3c98bb60b93a6e2f62579cf6b1eb63dd991']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['972d8291ee593dfa33746e340d546096a0799fb098bd00afd7c0d8b661566c14']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['deb01dc841079b6ab7c88f04158afddd09c6b210675f06adc9d5e64e28cc2d5d']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['352ef873c902ceea73e41ccabbc063f8717820bc50e654d4155cc2c92676c264']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['1ca0cf1e87a7a457abaa2baa8b458320f32dc5c2f78886675608d844b45f2111']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['04c4bb1ff43481169d2bb33ac2dcc3c98bb60b93a6e2f62579cf6b1eb63dd991']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['352ef873c902ceea73e41ccabbc063f8717820bc50e654d4155cc2c92676c264']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['972d8291ee593dfa33746e340d546096a0799fb098bd00afd7c0d8b661566c14']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['ecdf0f77eb914a372189969aa2a1cb4ecfcc9b680aa6cb0ac4ba39edf53de977']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['1ca0cf1e87a7a457abaa2baa8b458320f32dc5c2f78886675608d844b45f2111']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['c91d6646e7c08b197fe9d5ad265830f561b75b590741f124e51ecb01f23d3ecc']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['7a993202afd5a601d95e0e0882dac74cdd207bb06720feb256e54db85eab41b8']) timed out after 30 secs
INFO:ElectrumX:[671] incoming request Request('blockchain.scripthash.listunspent', ['ecdf0f77eb914a372189969aa2a1cb4ecfcc9b680aa6cb0ac4ba39edf53de977']) timed out after 30 secs
ERROR:MemPool:6562 txs dropped
INFO:MemPool:92,003 txs 37.98 MB touching 198,895 addresses
INFO:MemPool:compact fee histogram: [(40.0, 30009), (22.8, 33184), (16.3, 36693), (14.7, 53805), (13.9, 45379), (13.1, 57998), (12.0, 65033), (10.0, 58612), (8.8, 71648), (8.3, 73643), (7.0, 113000), (6.1, 97977), (6.0, 224391), (5.8, 129013), (5.7, 740512), (5.5, 212957), (5.4, 373571), (5.3, 257727), (5.2, 411211), (5.1, 126568), (5.0, 820971), (4.9, 727590), (4.8, 685447), (4.6, 469280), (4.4, 307170), (4.3, 24940), (4.2, 1456839), (4.1, 534148), (4.0, 2229582), (3.9, 2287957), (3.8, 935488), (3.7, 1006035), (3.6, 992901), (3.5, 891537), (3.3, 1236070), (3.2, 1153020), (3.1, 1577532), (3.0, 6871304), (2.8, 1215314), (2.5, 1251104), (2.2, 2822216), (2.1, 1901127), (1.9, 1829872)]

during synchronization of mempool, print a lot logs like above, and my api timeout. unable to respond during synchronization of mempool?

it's a significant impact on my use! what can i fix this?

zhiying8710 commented 11 months ago

in my case, i use electrumx as a backend service for my front app, so i dont use subcribe, i request the rpc interface to get all i need, when electrumx is updating mempool, the leveldb is occupied almost all the time, so other operation like listunspent is become unresponsive, my solution is:

  1. add env variable to control electrumx run mempool updating task or not, and add memory cache for mempool txs and hashXs.
  2. start a node do not run mempool updating task, and start second node will run fully functional include mempool updating.
  3. if need data from mempol, request the node which run fully functional; if the data is not in mempool, request the node which not running updating mempool task, then the request will not be block.
zhiying8710 commented 11 months ago

using rocksdb now, all work fine, no need two node described above