Skip to content

Excessive PubNub Heartbeat Requests (Hundreds per Minute) #491

@sonu-tz

Description

@sonu-tz

🐛 Bug: Excessive PubNub Heartbeat Requests (Hundreds per Minute)

Summary

We are observing an abnormally high number of PubNub heartbeat-related network requests being triggered in the client application.

Instead of the expected ~1 heartbeat every 30–60 seconds, the browser is sending hundreds of requests per minute (5–10 per second).

This is significantly higher than normal PubNub behavior.


Environment

  • Frontend: Angular - "pubnub": "9.7.0"
  • Real-time provider: PubNub
  • Browser: Chrome
  • Observed in: Production
  • Sentry enabled

Expected Behavior

  • A single PubNub instance should maintain:
    • 1 persistent WebSocket connection
    • OR 1 long-poll subscribe loop
    • Heartbeat interval ~30–60 seconds
  • Network activity should be minimal and stable when idle

Actual Behavior

  • 5–10 PubNub-related requests per second
  • Hundreds of requests per minute
  • Continuous activity even when user is idle
  • No visible leave or join events
  • Only one PubNub instance confirmed

Steps to Reproduce

  1. Open application
  2. Open Chrome DevTools → Network
  3. Filter by pndsn
  4. Observe continuous rapid requests

Impact

  • Increased network traffic
  • Potential quota overuse
  • Increased CPU usage
  • Possible memory churn

Initial Investigation Notes

  • Only one PubNub instance confirmed
  • No repeated unsubscribe / subscribe calls detected
  • Behavior resembles rapid reconnect or subscribe loop churn
  • Needs verification whether requests are:
    • /v2/presence/.../heartbeat
    • WebSocket reconnects

Severity

High – Potential production performance degradation and quota risk

Sample:
https://ps10.pndsn.com/v2/subscribe/sub-c-6034af17......../131-realtime-events/0?heartbeat=300&tt=17707263498638906&tr=33&uuid=2&requestid=49b9b474-d5a3-4fe2-9b08-fee45732ddfe&pnsdk=PubNub-JS-Web%2F9.7.0

Video:

Screencast.from.2026-02-10.18-22-31.webm

Image:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions