k3s and SQLite: API Server Latency During Concurrent Write Operations
0 reputation · 25 Nov 2020, 22:02 UTC
Datastore Concurrency and API Performance
k3s utilizes a default SQLite backend via the kine wrapper to provide a lightweight alternative to etcd. While this simplifies deployment, SQLite employs a single-writer model that may introduce bottlenecks when the Kubernetes API server handles a high volume of simultaneous write requests.
In environments with frequent object updates or high churn, the contention for the database write lock can lead to increased request latency or transient locking errors. This behavior is closely tied to the underlying disk I/O performance where the SQLite file is stored.
Given these architectural constraints in k3s v1.28+, what are the specific thresholds where SQLite write contention becomes a primary driver of API latency? At what scale of concurrent operations does migrating to an external PostgreSQL or MySQL datastore become necessary to maintain stable response times?