Exceeding XenAPI Session Limit Causes Pool Instability

Exceeding XenAPI Session Limit Causes Pool Instability

book

Article ID: CTX137488

calendar_today

Updated On:

Description

XenAPI Session

The session limit of XenAPI process (XAPI) is 400. When the limit is exceeded, the oldest session is terminated. The oldest session might be active and in use. When the session is terminated, the client using that session gets disconnected without notification.

Note: Clients can be any of the following: slaves in the pool, users running XenCenter, third-party applications that leverage XAPI, internal Dom0 processes, cloud management applications, distributed desktop controllers, or any systems interacting with the pool through XAPI.

A session is created when a client logs on to the server using the session.login_with_password call. The client gets a session ID to make API calls.

If a session is no longer needed, the client must close the session and release it back to the pool. If a session has not been used for 24 hours, it is automatically closed.

A session is continued on the server across connections. After logged on once, the session can be used for every subsequent API call from the client to the server, even during multiple concurrent API calls. More than one session is not required per client at a time.

Following is the sample log entries when the limit is exceeded:

Mar 17 22:47:57 xenbaa01 xapi: [debug|xenbaa01|17 db_gc|DB GC D:a12c190b8756|db_gc] 
Number of disposable sessions in database (402/407) exceeds limit (400): will delete the oldest
Mar 17 22:47:57 xenbaa01 xapi: [debug|xenbaa01|17 db_gc|DB GC D:a12c190b8756|db_gc] 
Session.destroy _ref=OpaqueRef:887ec4ba-0a8d-36c4-9082-bd6e36b05be8 
uuid=2f23c7b4-8642-5fee-7ef0-b08656be66d7 trackid=490d2f7aa6d231d6566216fb19002e04 
(last active 20121218T01:16:01Z): Timed out session because max number of sessions was exceeded
Mar 17 22:47:57 xenbaa01 xapi: [debug|xenbaa01|17 db_gc|DB GC D:a12c190b8756|db_gc] 
Session.destroy _ref=OpaqueRef:1f2be87f-b39c-47ce-14dd-44ca116dce55 uuid=7c88d598-d26f-5ff8-fdda-f18938efb354 trackid=1da8b39b19ca02748cc6d69e098aba5c (last active 20121218T01:15:37Z): Timed out session because max number of sessions was exceeded

The Auto Support plugin identifies this condition, and triggers when the event is occurred more than 30 times per hour. This behavior does not cause a noticeable impact until the number of destroyed connections increases to a higher rate.

Following are the factors which lead to exceeding XAPI session limit:

  • Too many client connections

  • Internal Dom0 processes that leak sessions

  • Third-party apps that do not reuse their sessions

  • Custom management scripts consuming sessions

Some known leakages in Dom0 processes have been addressed in the following hotfixes.

    Issue/Introduction

    This article provides information on the scenario that exceeding the XenAPI session limit causes pool instability.