ethersphere / bee

Bee is a Swarm client implemented in Go. It’s the basic building block for the Swarm network: a private; decentralized; and self-sustaining network for permissionless publishing and access to your (application) data.
https://www.ethswarm.org
BSD 3-Clause "New" or "Revised" License
1.46k stars 337 forks source link

Delay in First SOC Upload After Node Startup #4860

Open nugaon opened 1 week ago

nugaon commented 1 week ago

Context

Summary

After starting the node, the first Single Owner Chunk (SOC) upload takes an unusually long time. It appears that there might be a lock causing this delay, particularly around a specific debug log entry.

Expected behavior

The SOC upload should occur promptly after the node starts without significant delays.

Actual behavior

The first SOC upload after node startup is delayed significantly. The suspected cause is a lock around the following log entry:

"time"="2024-10-10 14:54:36.734229" "level"="debug" "logger"="node/salud" "msg"="computed" "avg_dur"=0.001058165 "pDur"=0.001001986 "pConns"=1 "network_radius"=0 "neighborhood_radius"=0 "batch_commitment"=191889408

Steps to reproduce

  1. Start the node with the usual configuration.
  2. Attempt to upload a SOC immediately after the node becomes operational.
  3. Observe the delay in the upload and check the node's log for the debug entry mentioned above.

Possible solution

Investigate the locking mechanism around the log entry point to determine if it is necessary or if it can be optimized to allow faster processing. This might involve reviewing the synchronization strategy around the shared resources involved in the SOC upload process.

acha-bill commented 1 week ago

Can you provide the config you start the node with? Also how much delay are you experiencing? This might be related to your warmup time