Controls whether PolarDB maintains persistent HTTP connections to external AI model services. When enabled, the connection to the AI service is reused across requests, reducing the overhead of repeated connection establishment.
Parameter details
| Attribute | Value |
|---|---|
| Data type | Boolean |
| Valid values | ON, OFF |
| Scope | Session, database |
Values
ON: Enables HTTP keep-alive. The connection to the AI service is reused across multiple requests, reducing connection overhead for repeated AI calls.
OFF: Disables HTTP keep-alive. Each AI request opens and closes a new HTTP connection.
Set the parameter
Session scope
Use session scope when testing or temporarily changing connection behavior without affecting other sessions.
SET polar.ai.http_keep_alive = ON;Database scope
Use database scope to apply a consistent default across all sessions that connect to the database.
ALTER DATABASE <dbname> SET polar.ai.http_keep_alive = OFF;Replace <dbname> with the name of the target database.