mirror of
https://github.com/gravitational/teleport
synced 2024-10-22 18:23:25 +00:00
8356ae6a74
This commit expands the usage of the caching layer for auth server API: * Introduces in-memory cache that is used to serve all Auth server API requests. This is done to achieve scalability on 10K+ node clusters, where each node fetches certificate authorities, roles, users and join tokens. It is not possible to scale DynamoDB backend or other backends on 10K reads per seconds on a single shard or partition. The solution is to introduce an in-memory cache of the backend state that is always used for reads. * In-memory cache has been expanded to support all resources required by the auth server. * Experimental `tctl top` command has been introduced to display common single node metrics. Replace SQLite Memory Backend with BTree SQLite in memory backend was suffering from high tail latencies under load (up to 8 seconds in 99.9%-ile on load configurations). This commit replaces the SQLite memory caching backend with in-memory BTree backend that brought down tail latencies to 2 seconds (99.9%-ile) and brought overall performance improvement.
19 lines
510 B
Go
19 lines
510 B
Go
package backend
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
const (
|
|
// DefaultBufferSize is a default circular buffer size
|
|
// used by backends to fan out events
|
|
DefaultBufferSize = 1024
|
|
// DefaultPollStreamPeriod is a default event poll stream period
|
|
DefaultPollStreamPeriod = time.Second
|
|
// DefaultEventsTTL is a default events TTL period
|
|
DefaultEventsTTL = 10 * time.Minute
|
|
// DefaultLargeLimit is used to specify some very large limit when limit is not specified
|
|
// explicitly to prevent OOM
|
|
DefaultLargeLimit = 30000
|
|
)
|