cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.06k stars 3.8k forks source link

admission control: implementation of the sqlNodeCPUOverloadIndicator for single-tenant SQL nodes #79425

Open rytaft opened 2 years ago

rytaft commented 2 years ago

This is a separate issue for the third item in #65954.

sqlNodeCPUOverloadIndicator is the implementation of the cpuOverloadIndicator interface for a single-tenant SQL node in a multi-tenant cluster. This has to rely on the periodic load information from the cpu scheduler and will therefore be tuned towards indicating overload at higher overload points (otherwise we could fluctuate into underloaded territory due to restricting admission, and not be work conserving). Such tuning towards more overload, and therefore more queueing inside the scheduler, is somewhat acceptable since a SQL node is not multi-tenant.

This issue covers the work to implement it, since isOverloaded() currently just returns false.

Epic CRDB-13762

Jira issue: CRDB-14838

jeffswenson commented 2 years ago

Admission control in the SQL server is very valuable for Serverless clusters. The Serverless infrastructure can reduce load on a SQL Server by migrating connections between SQL servers. Preventing overload from toppling the SQL Server helps ensure we can always migrate connections.