magicpak icon indicating copy to clipboard operation
magicpak copied to clipboard

More cpu usage / throttling after switching to from scratch

Open grosser opened this issue 2 years ago • 4 comments

for a ruby example app that we converted we saw cpu and throttling jump pretty bad (it's not a big deal since it's still super small), but some guidance on why this might happen and how to avoid it would be great for onboarding apps where performance actually matters.

image

grosser avatar Jun 06 '22 16:06 grosser

I tried to reproduce this using minimal Sinatra HTTP server but I couldn't find any significant difference. https://gist.github.com/coord-e/cf89553d0f5f3078720db14432ac857a cpu usage

@grosser Could you give me some more details about the situation so that I can reproduce this on my end? What kind of application are you running?

coord-e avatar Nov 14 '22 07:11 coord-e

ruby worker ... I'll try to reproduce and add more details if I can 🤞

grosser avatar Nov 14 '22 16:11 grosser

  • ran simple benchmark and no success

git clone https://github.com/Shopify/yjit-bench into lib then run via ruby -rrbconfig -I lib/yjit-bench/harness lib/yjit-bench/benchmarks/binarytrees/benchmark.rb

  • binarytrees same
  • etanni 10% slower
  • fannkuchredux same ... so idk what's going on there

also tried running with gcr.io/distroless/base-debian10 (and without jmalloc) which gave less throttling but same cpu usage normal (first 1/2), ubuntu (Fri 2), debian (last 1/8th) SCR-20221202-vev

I'll need to look into our app and see if some specific action is slower than normal

grosser avatar Dec 02 '22 22:12 grosser

this is from a stats app that does lots of small things, so tried each individually by making it do 100 iterations in a loop

  • computation heavy (PodHealth): same
  • network heavy (PodNetworkError): same
  • aws api heavy (MissingAmiReporter): same
  • connecting to internal app (VaultReachability): same ... so maybe this is just some reporting foobar 🤷

idk where to go from here ... maybe someone who knows more about how container metrics are reported can chime in ...

grosser avatar Dec 11 '22 22:12 grosser