---
title: "Do WebSockets need a ping to stay alive with Alchemy?"
description: "Find out if WebSockets need a ping to stay connected with Alchemy."
---

# Do WebSockets need a ping to stay alive with Alchemy?

When using Alchemy’s WebSockets, it’s important to understand how “pings” work for maintaining your connection and ensuring communication with the Alchemy servers.

## SDK heartbeat ping
Our Alchemy SDK automatically sends a `net\_version` heartbeat ping to the Alchemy servers every 30 seconds. This is done to maintain the connection and verify the server’s liveness. The great news is that these pings incur **zero Compute Units \(CUs\) consumption**.

<CalloutBlock>
  📘 For more details on the net_version method, you can refer to our
  documentation here.
</CalloutBlock>

## Do you need to send pings?
You **don’t need to manually send pings** to keep your WebSocket connection alive. Alchemy servers will periodically send pings to your client to check for liveness, and as long as your client responds to these pings, the connection will remain active.

## Final thoughts
To maintain your WebSocket connection with Alchemy, rely on the SDK’s automatic net_version pings or the pings sent by the server. There’s no need to implement custom pings on your end. Just ensure your client responds to the server’s pings to keep the connection alive!
