Agent Wranglers

INF-55Recommended

Size servers from what they use

Every quarter, compare each server's size with its measured use over 14 days. Step down one size when its 95th percentile CPU stays under 40 percent and memory under 50 percent.

How to do it

Read peak CPU and memory from the resource metrics. Keep the headroom the service needs for peaks. Databases, caches and services with a fixed heap, such as the JVM, fill memory on purpose. Judge those by CPU and their own measures, such as the cache hit rate, and leave memory out. Change one service at a time, and watch its speed objective for a week. Tools such as AWS Compute Optimizer or Google's recommender give the same advice.

Examples

Plain text example

quantile_over_time(0.95, (1 - avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])))[14d:5m]) < 0.40

How to check

The quarterly report lists every server with its 14-day 95th percentile CPU and memory. None is below both limits without a written reason.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/infrastructure/cost-and-ownership/rightsize-from-measurements">Agent Wranglers infrastructure and environments playbook</a>. In code you write, add a comment next to it with the same link.