QuestDB’s ILP/TCP receiver provides reliable, high-throughput ingestion of time-series data over TCP connections. This is the recommended method for production workloads.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/questdb/questdb/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The TCP receiver listens on port 9009 by default and supports:- Persistent connections - Connection pooling for reduced overhead
- Authentication - Optional elliptic curve authentication for security
- Error handling - Synchronous error responses for failed writes
- Binary protocol support - Efficient binary encoding for arrays and decimals
- Batching - Send multiple measurements per connection for high throughput
Quick Start
Basic Ingestion
Connect to QuestDB and send ILP messages over TCP:Batch Ingestion
Send multiple measurements in a single connection:Connection Management
Connection Lifecycle
- Connect - Establish TCP connection to port 9009
- Authenticate (optional) - Complete authentication handshake if enabled
- Send data - Write one or more ILP messages, each terminated by
\n - Receive errors (if any) - Server sends error messages for invalid data
- Close - Close the connection or keep alive for reuse
Connection Pooling
For high-throughput applications, maintain a pool of persistent connections:Protocol Features
Text Format
The standard ILP text format is supported:Binary Format
For arrays and high-precision decimals, QuestDB supports a binary encoding using the== prefix:
- Type byte (1 byte): Identifies the data type
- Length (1+ bytes): Size of the value
- Value (N bytes): Binary-encoded data
BOOLEAN(type: 6)FLOAT(type: 2) - 4 bytesDOUBLE(type: 16) - 8 bytesINTEGER(type: 3) - 4 bytesLONG(type: 15) - 8 bytesTIMESTAMP(type: 13) - 9 bytes (1 byte unit + 8 bytes value)ARRAY(type: 14) - Variable lengthDECIMAL(type: 23) - Variable length (1 byte scale + 1 byte length + N bytes value)
Message Termination
Each ILP message must be terminated with a newline character (\n or \r\n):
Error Handling
The TCP receiver validates each message and may return error responses:Error Response Format
Errors are sent as text messages over the same connection:Common Errors
Empty message received. Ensure each message contains at least a table name and one field.
No fields provided in the message. At least one field is required.
Field value cannot be parsed. Check data type suffixes and formatting.
Timestamp cannot be parsed. Ensure it’s a valid integer with optional unit suffix.
Incorrect separator between message components. Use commas for tags, spaces between sections.
Error Handling Example
Performance Tuning
Buffer Sizing
Size of the receive buffer per connection. Increase for larger messages.
Maximum receive buffer size. Guards against memory exhaustion.
Maximum number of fields per measurement. Increase for wide tables.
Commit Configuration
Maximum time between commits. Lower values reduce data loss risk but may decrease throughput.
Fraction of the target commit interval used for actual commits. Provides headroom for write spikes.
Worker Threads
Capacity of the writer queue. Increase for higher write concurrency.
Time before idle table writers are released. Lower values free resources faster.
Configuration
TCP receiver configuration is set inserver.conf:
Configuration Properties
Enable or disable the ILP/TCP receiver.
Network interface and port to bind. Use
0.0.0.0 for all interfaces.Path to authentication database. If null, authentication is disabled.See Authentication for details.
Automatically create tables from ILP messages. If false, tables must be pre-created.
Automatically add columns to existing tables. If false, messages with unknown columns are rejected.
Default partitioning strategy for auto-created tables:
NONE, DAY, WEEK, MONTH, YEAR.Default timestamp unit when no suffix is provided:
nanos, micros, millis.Disconnect client connections after errors. If false, connections remain open.
Best Practices
Monitoring
Monitor ILP/TCP health using these metrics:- Connection count - Number of active TCP connections
- Write throughput - Rows per second ingested
- Error rate - Failed writes per second
- Commit latency - Time to commit data to disk
- Buffer utilization - Receive buffer usage
/metrics REST endpoint and system tables.