Horizontal autoscaling

수평 자동 확장

Change the number of running replicas in response to load metrics.

···
html
<div class="stage" data-phase="0"><div class="title">LOAD → REPLICAS</div><div class="meter"><div class="fill"></div><span>requests</span></div><div class="row replicas"><div class="panel">P1</div><div class="panel">P2</div><div class="panel extra">P3</div><div class="panel extra">P4</div></div><div class="sub">target utilization controls count</div></div>
css
.stage{width:min(94vw,760px);height:min(88vh,330px);padding:clamp(9px,2.6vmin,20px);border:1px solid var(--line);border-radius:14px;background:var(--surface);font:600 clamp(12px,2.5vmin,16px)/1.3 "Pretendard Variable",Pretendard,-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo",sans-serif;display:flex;flex-direction:column;gap:clamp(6px,1.7vmin,12px);overflow:hidden;position:relative}.stage *{min-width:0}.stage .title{color:var(--accent);font-weight:800}.stage .sub{color:var(--muted)}.stage .row{display:flex;align-items:center;gap:clamp(5px,1.6vmin,12px)}.stage .panel{border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:clamp(6px,1.6vmin,12px)}.stage .mono{font-family:ui-monospace,SFMono-Regular,monospace;font-size:clamp(12px,2.5vmin,15px)}.stage .grow{flex:1}.stage .on{color:var(--accent)}.meter{height:clamp(28px,7vmin,48px);border:1px solid var(--line);border-radius:7px;position:relative;overflow:hidden}.meter span{position:absolute;left:9px;top:50%;transform:translateY(-50%)}.fill{width:30%;height:100%;background:color-mix(in srgb,var(--accent) 36%,var(--surface));transition:width .4s}.replicas{flex:1;justify-content:center}.replicas .panel{flex:1;text-align:center;max-width:120px}.extra{color:var(--muted);border-style:dashed!important;transform:scale(.9);transition:transform .4s,background .4s}.stage[data-phase="1"] .fill{width:90%;background:color-mix(in srgb,var(--accent-3) 45%,var(--surface))}.stage[data-phase="2"] .fill{width:55%}.stage[data-phase="2"] .extra{transform:scale(1);border-color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 15%,var(--surface))}
js
const stage=document.querySelector('.stage');let phase=0;function advance(){phase=(phase+1)%3;stage.dataset.phase=String(phase)}const timer=setInterval(advance,1200);stage.addEventListener('pointerdown',()=>{clearInterval(timer);advance()})

Horizontal autoscaling compares current load with a target and adjusts replica count. New pods cannot absorb traffic until they are ready.

The demo grows two replicas to four as requests rise, then scales down. Stabilization windows help prevent rapid oscillation around a threshold.

When to use

Use it to adapt capacity for a stateless service with changing traffic.

Open as page ↗