apotdevin / thunderhub

ThunderHub LND Lightning Node Manager in your Browser
https://www.thunderhub.io/
MIT License
412 stars 84 forks source link

[BUG] Main screen and forwards screen unresponsive due to new year totals of forwards #590

Open mutatrum opened 9 months ago

mutatrum commented 9 months ago

Describe the problem/bug I have a moderately busy routing node, and have around ~500k routings over the last year.

With 0.13.24, a Year aggregate of forwards has been added to the home screen and the forwards screen.

This takes about 6 minutes of processing time on my server, after which a 126MB of GraphQL is sent back to my browser for another 2 minutes of processing time. The memory usage of the Chrome tab balloons to 3.3GB and (I think due to an automatic refresh) after a few more minutes the tab is unresponsive.

The server is an Intel Xeon E-2286G with 64GB memory, storage is SSD. The client is an 8th gen Intel i7, so also not slow by any means.

Expected behavior In 0.13.23, it took about 5 seconds for the aggregates to show up, with maybe a 2 second process time of the browser. I couldn't extend the graph to anything beyond 7D, as that would blow up the system (or I never waited long enough).

It seems all forwards are requested for the last 365 days, with a GetForwardsList. I would expect that the aggregation of week, month and year is done by the underlying database, not on the browser. My guess is that would speed things up immensely.

In the current state I'm afraid ThunderHub is close to unusable for a decently sized lightning node.