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

CLNRest high CPU usage #1443

Open
sha-265 opened this issue Sep 26, 2024 · 6 comments
Open

CLNRest high CPU usage #1443

sha-265 opened this issue Sep 26, 2024 · 6 comments
Assignees

Comments

@sha-265
Copy link

sha-265 commented Sep 26, 2024

Describe the bug
When using RTL with CLNRest, the CLNRest's python process is using a lot of CPU, after login to RTL.

This high CPU usage didn't happen with c-lightning-REST.

To Reproduce
Steps to reproduce the behavior:

  1. Config RTL to work with CLNRest
  2. Login to RTL
  3. See CLNRest CPU usage

Your environment

  • Version of RTL: v0.15.2-beta
  • Version of core lightning: 23.11.2
  • Version of bitcoind: 26.2
  • Operating system (uname -a on *Nix): Ubuntu 20.04
@ShahanaFarooqui
Copy link
Collaborator

I tried the steps you provided above with CLN v23.11.2, RTL v0.15.2-beta & Ubuntu 22.04. But my CPU usage for clnrest reached maximum upto 0.1% & memory upto 0.2%. But I did not have much data in my node to test for.

Screenshot from 2024-09-26 09-46-32

Could you please confirm how much CPU usage clnrest takes when you login to RTL? Does your node have huge number of invoices/forwards/payments etc?

@ShahanaFarooqui
Copy link
Collaborator

And this is the usage from CLN v24.08.1 node which has decent data volume:

Screenshot from 2024-09-26 10-01-45

@ShahanaFarooqui
Copy link
Collaborator

Can you also confirm your Core lightning's log-level. clnrest uses the log-level set by Core lightning as described in the config. clnrest could be taking time in logging if the level is set to log everything.

@sha-265
Copy link
Author

sha-265 commented Sep 26, 2024

Could you please confirm how much CPU usage clnrest takes when you login to RTL? Does your node have huge number of invoices/forwards/payments etc?

image

This node is running for few years. I don't know what huge means, but there is ~10K failed forwards and pays.

Can you also confirm your Core lightning's log-level. clnrest uses the log-level set by Core lightning as described in the config. clnrest could be taking time in logging if the level is set to log everything.

The log level is the default one. It's not set in the config.

@ShahanaFarooqui
Copy link
Collaborator

The default log level is set to info, which minimizes the amount of logging from clnrest.

Additionally, I created a new node with 6K invoices, 6K payments, 8K forwards & 10K local_failed forwards to test CPU usage. During testing, the CPU usage peaked at only 3% when loading the RTL dashboard. All other pages showed even lower CPU usage.

Running autoclean-once on failed forwards and payments might improve the node’s performance slightly.

What is your system configuration?

@sha-265
Copy link
Author

sha-265 commented Sep 27, 2024

You mean hardware wise? It's a dual core x64 PC, with 8GB memory.

The only think that I think could be related is the remote backup I have, which also use high CPU when logging in to RTL.

ShahanaFarooqui added a commit that referenced this issue Nov 11, 2024
* Fix `Unknown command` error when disabling offers on CLN. ([#1443]) (#1451)
* Add missing SSO options to config (#1455)
* Fix for cln logic screen navigation (#1457)
* Transactions destination address display fix (#1458)
* cln delexpiredinvoices deprecation fix (#1459)
* Read LN_IMPLEMENTATION from environment (#1460)
* Add Fee Rate Information on Send Funds Modal (#1461)
* Artifact script fix (#1464)
* Add AMP toggle for LND Send Payments (#1466)

---------

Co-authored-by: Se7enZ <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants