Skip to content

Configuration & env flags

VariableDefaultEffect
IFX_BUFFERED_READER1Enable connection-scoped read buffer (Phase 39). Set to 0 to disable.
IFX_DEBUG_WIREunsetWhen set to a truthy value, log wire-level PDU framing to stderr. Verbose; for debugging only.
IFX_PROTOCOL_TRACEunsetWhen set to a path, write annotated wire captures to the file.
IFX_DISABLE_PIPELINEunsetDisables pipelined executemany (Phase 33). Use only to A/B-measure.
INFORMIXSERVER(none)Read by connect() if server= is not provided.

Environment variables are read at connection construction. Changing them at runtime doesn’t affect existing connections.

Full keyword list for informix_db.connect():

ArgTypeDefaultNotes
hoststrrequiredTCP host.
portint9088TCP port. 9089 is the typical TLS listener.
userstrrequired
passwordstrrequired
databasestr | NonerequiredNone logs in without selecting a DB.
serverstrrequiredDBSERVERNAME, not hostname.
autocommitboolFalse
connect_timeoutfloat | NoneNoneTCP+login timeout.
read_timeoutfloat | NoneNonePer-read timeout.
keepaliveboolFalseSO_KEEPALIVE.
client_localestr"en_US.8859-1"See SQL ↔ Python types for codec mapping.
envdict[str, str] | NoneNoneServer-side session env.
tlsbool | ssl.SSLContextFalseSee Connect with TLS.
row_factorytype | NoneNoneinformix_db.Row for name and attribute access. See Rows.
fetch_buffer_sizeint0Bytes per fetch. 0 derives it from the row width. See below.

Leave it at 0 unless you are fetching a lot of rows. The driver then sizes each fetch from the result set’s own row width, which is the figure the server reports in its DESCRIBE response.

Raising it trades memory for round-trips. Measured on a 50,000-row eight-column fetch:

BudgetRound-tripsTime
0 (4096 for this shape)563331 ms
16 KiB142271 ms
64 KiB37264 ms

About 1.25x, with the knee between 16 and 64 KiB and nothing useful above it. A value below one row is raised to the row width, since a budget under one tuple cannot fetch anything.

ArgDefaultEffect
min_size1Connections to pre-warm at create time.
max_size10Hard cap.
acquire_timeout30.0Raise PoolTimeout after this many seconds.
max_idle600.0Close connections idle longer than this (seconds).
health_checkTrueValidate idle connections before returning from the pool.

All other connection arguments are forwarded to each pool-created connection.

The env={} parameter of connect() sets server session variables sent in the login PDU:

informix_db.connect(
...,
env={
"OPT_GOAL": "-1", # optimize for first-row return
"OPTOFC": "1", # auto-free cursors at fetch-close
"IFX_AUTOFREE": "1",
},
)

CLIENT_LOCALE is set automatically from client_locale=, so don’t put it in env=.