Skip to content

gRPC listchannels & listnodes performance #7984

@michael1011

Description

@michael1011

Getting all nodes or channels CLN has gossip for via the gRPC interface is really slow. Calling listchannels via gRPC takes a minute while the CPU usage of the gRPC plugin spikes to 100% on one core

image

It is definitely not a problem with my CLN installation or my machine because the RPC socket socket is quick:

time lightning-cli listchannels | jq .channels > /dev/null

real    0m4.508s
user    0m2.125s
sys     0m0.273s

getinfo output

{
   "id": "02ead25af6e0271c5167d6fd05545d2d538995ce3e16ad780a1010fc4e91522202",
   "alias": "LOUDGOPHER",
   "color": "02ead2",
   "num_peers": 0,
   "num_pending_channels": 0,
   "num_active_channels": 0,
   "num_inactive_channels": 0,
   "address": [],
   "binding": [
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 9745
      }
   ],
   "version": "v24.11-28-gdac505d",
   "blockheight": 878642,
   "network": "bitcoin",
   "fees_collected_msat": 0,
   "lightning-dir": "/home/michael/.lightning/bitcoin",
   "our_features": {
      "init": "08a0880a8a59a1",
      "node": "88a0880a8a59a1",
      "channel": "",
      "invoice": "02000002024100"
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions