Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to limit the API request rate? #1067

Open
ShahanaFarooqui opened this issue Aug 16, 2022 Discussed in #1066 · 10 comments
Open

Is there a way to limit the API request rate? #1067

ShahanaFarooqui opened this issue Aug 16, 2022 Discussed in #1066 · 10 comments

Comments

@ShahanaFarooqui
Copy link
Collaborator

Discussed in #1066

Originally posted by DerEwige August 16, 2022
My RTL freezes (overloads) my eclair node when it tries to load the invoices.
(When I go to lightning -> transactions)

The node CPU goes up to 100% (4 cores) and I get time out errors in the logs for http://localhost:8080/listinvoices

I asume that RTL has problem handling over a million of invoices.
Is there an option in the config to tell RTL to load the data slower?

@DerEwige
Copy link

Some additional info regarding this problem.

The issue happens because I have several hundred thousend invoices in my database.
RTL tries to fetch them all at once. This results in a timout of the API call and then RTL tries again.

Solution: use the from and to fields of the listinvoice API point and if it gives a timeout reduce the time to get smaller junks

@saubyk saubyk added this to the Release v0.13.2-beta milestone Sep 5, 2022
@ShahanaFarooqui
Copy link
Collaborator Author

@DerEwige Thank you for the issue.

After analysing it more closely, we believe that it will be better handled if pagination option is added for the API. I opened two issues requesting pagination on listinvoices and audit APIs as below:
ACINQ/eclair#2450
ACINQ/eclair#2451

I also opened another issue to delete any unpaid expired invoice in order to remove unnecessary records from the node:
ACINQ/eclair#2449

I am putting this issue on hold until at least 2450 is addressed.

@ShahanaFarooqui
Copy link
Collaborator Author

ShahanaFarooqui commented Oct 10, 2022

@DerEwige Eclair will provide an option to delete all unpaid expired invoices in their next release.

Please feel free to configure if you have a lot of expired invoices.

We will improve both API request as soon as pagination is available.

@DerEwige
Copy link

Thanks @ShahanaFarooqui for sharing
Once the new release drops. I will defenitly use this

@ShahanaFarooqui
Copy link
Collaborator Author

Unblocked with PR ACINQ/eclair#2474

@mviswanathsai
Copy link

Hey! I am looking to contribute, can someone guide me on where I can start?

@ShahanaFarooqui
Copy link
Collaborator Author

Hey, you can start by following https://github.com/Ride-The-Lightning/RTL/blob/master/.github/docs/Contributing.md and start a new thread in discussions board if more information is needed after that.

@mviswanathsai
Copy link

mviswanathsai commented Dec 14, 2022 via email

@ShahanaFarooqui
Copy link
Collaborator Author

Pagination cannot be implemented without API responding with total number of records which is missing currently.
I will wait for the issue 2855 to add this in the response before implementing it in the UI.

@ShahanaFarooqui
Copy link
Collaborator Author

Updated code to enable pagination in future (whenever APIs are fixed) with PR #1393.

@ShahanaFarooqui ShahanaFarooqui modified the milestones: 0.15.1, 0.15.2 May 14, 2024
@saubyk saubyk modified the milestones: 0.15.2, 15.3 Jun 13, 2024
@ShahanaFarooqui ShahanaFarooqui modified the milestones: 0.15.3, 0.15.4 Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants