Impact of frequent API connections and orphaned sessions on vCenter Server
search cancel

Impact of frequent API connections and orphaned sessions on vCenter Server

book

Article ID: 437427

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

When running automated scripts or tools that connect to the vCenter Server API every 10 minutes, understanding the architectural impact on the environment is essential. Concerns regarding system stability, database growth, or service overhead may arise during continuous 24x7 polling. This article explains how the vCenter Server service (vpxd) manages frequent authentication requests and outlines the required best practices to prevent API session exhaustion.

Environment

VMware vCenter Server 8.0

Resolution

Connection Sequence

Every time a script or tool connects to vCenter Server, the following sequence occurs:

  • Authentication: vCenter Single Sign-On (SSO) processes the provided credentials.

  • Session Creation: The vpxd service allocates memory and generates a unique Session ID.

  • Event Logging: The system writes a "User logged in" event to the PostgreSQL database and the vpxd.log files.

  • Execution: The vpxd service and the database process the API request.

Architectural Impact of Orphaned Sessions

  • Idle Timeout Retention: If a script fails to log out, the session remains in vCenter Server memory for up to 120 minutes (default idle timeout).

  • Session Accumulation: Due to the two-hour delay, a stack of 12 orphaned sessions will continuously reside in memory for scripts running every 10 minutes.

  • Service Blocking: Reaching the maximum concurrent session limit (typically 3,000 in vCenter 8.0u3) blocks all further API integrations, including backups and management tools.

  • Increased Overhead: Polling without proper teardown increases service overhead on the vpxd service and creates significant noise in security and vpxd logs.

Recommended Best Practices

  • Stateless Operation: Configure scripts and tools to operate statelessly.

  • Explicit Logout: Include an explicit Logout() call at the end of every execution cycle to immediately free memory and session allocations.

  • Audit Compliance: Properly closing sessions ensures accurate recording of "User logged out" events, maintaining exactly 288 audit events per day for 10-minute polling cycles.

  • Database Health: Rely on default database retention policies (typically 30 days) to automatically purge minimal daily log churn and prevent database bloat

Additional Information

To increase the maximum concurrent session, refer to the article vAPI session maxSessionCount is consolidated within vpxd