How to efficiently manage peer discovery in a dynamic libp2p network?

Hi everyone,

I am currently building a decentralized app using libp2p and running into challenges with peer discovery in a highly dynamic environment. I am using the JavaScript implementation.., and while the built-in mDNS and bootstrap nodes help initially, things get unreliable as peers frequently join and leave.

My goal is to maintain a more stable view of the network without depending on centralized coordination. I have explored DHT for peer routing…, but sometimes it adds noticeable latency. I also noticed peers occasionally get “stuck,” not discovering new ones unless restarted.

Does anyone have recommendations or best practices on:

Improving peer discovery refresh cycles

Handling churn gracefully

Balancing discovery and performance in real-time apps

Would also appreciate any examples or insights from your projects. I am aiming to keep things lightweight but resilient. Open to trying out other discovery modules or configurations if it leads to better stability. I have also searched on the forum and got this one thread https://discuss.libp2p.io/t/small-group-use-case-10-peers-optimal-peer-discovery-protocol-salesforce-training-in-pune but couldn’t get enough help.

Thanks in advance for any guidance !!

With Regards,
Marcelo