my "dedicated vCPU" is showing 40% steal and the host says it's normal??

da_real_mvp

New Member
Messages
69
Reaction score
0
Location
Atlanta, GA

so I've been chasing a random latency issue on one of my boxes for like two weeks. nothing in the app logs, nothing in dmesg, load average looks fine (0.4 on 4 vCPU), but every so often a request just... hangs for 200-400ms. completely random.

finally ran mpstat -P ALL 2 10 and just stared at it. steal time on two of the four cores was bouncing between 15% and 40%. on a plan that literally says "dedicated vCPU" in the marketing copy. dedicated!!

opened a ticket, sent them the mpstat output, and got the classic reply: "steal time is a normal metric on virtualized environments and does not indicate an issue." bro. 40% steal means the hypervisor is handing my CPU time to someone else. that IS the issue. that's the whole issue lol.

anyway, a few things I've learned the hard way:

  • vmstat 1 steal column is the one to watch, not %idle. I was staring at idle% for days like an idiot.
  • cat /proc/pressure/cpu (PSI) is way more useful than load average if you're on a recent kernel. it'll tell you if tasks are actually getting stalled.
  • if your provider won't move you to a quieter host, you can sometimes just... redeploy to a different region and get lucky. I've done this. feels dumb but it works.
  • KVM on a 1:1 vCPU:pCPU pinning is what you actually want. oversold OpenVZ/LXC on a busy node and you're just along for the ride.

so now I'm running my own little steal-time logger (5 second samples to a csv, alerts if 5min avg crosses 10%) and it's honestly been more useful than half the monitoring I pay for.

anyone else deal with this? is there a provider out there that actually pins cores and doesn't bullshit you about it? because I'm tired of playing host roulette every time the node gets busy.

nightowl87

New Member
Messages
60
Reaction score
0
Location
Portland, OR

wait, is steal the column that shows up in top as "st" too? because I've been half-ignoring that for months thinking it was something to do with disk. feeling pretty dumb right now.

also curious about the CSV logger, how much overhead does it actually add? I'm on a $6 VPS so I'm paranoid about my own monitoring eating the CPU I'm trying to measure lol. did you just cron a little bash script or use something fancier?

and yeah the "normal metric" reply is infuriating. everything is a normal metric if you define normal loosely enough.

danielp77

New Member
Messages
51
Reaction score
0
Location
Melbourne, AU

yeah st in top is steal, same as the st column in vmstat. blew my mind when I finally connected those dots, it just sits there in the header for years and you never register it.

on the overhead question, basically nothing. reading /proc/stat is a couple microseconds of kernel time, the only real cost is spawning the shell every sample. I cron'd it at first then switched to a little while loop with sleep 5 under a systemd unit, one long-lived bash process, one fork every 5 seconds. on a $6 box that's lost in the noise. just don't pipe top -b into anything on a loop, that one actually costs you.

one gotcha though: what are you running, KVM or a container? if it's LXC/OpenVZ then /proc/stat is often the host's, so your CSV is measuring the whole node's steal, not your slice. still useful but it'll spike for reasons that have nothing to do with you and you'll chase ghosts. KVM gives you your own view.

and 40% steal on a "dedicated vCPU" plan is exactly why I stopped trusting plan names. dedicated apparently means "we promise not to sell this core twice, probably, unless it's tuesday."

FrostyBear

New Member
Messages
67
Reaction score
0
Location
Brisbane, AU

wait how do you actually tell which one you're on? is there a command for that or do you just have to dig through your provider's docs and hope they're being honest lol.

I'm on some cheap VPS I grabbed during a Black Friday deal and now I'm paranoid it's OpenVZ and my whole steal CSV has been quietly measuring the neighbors this entire time. that would explain so much honestly.

and the "unless it's tuesday" line got me. I fully believed the dedicated vCPU thing when I signed up. rookie move I guess.

You must log in or register to reply here.