magicpak
magicpak copied to clipboard
More cpu usage / throttling after switching to from scratch
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.
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
@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?
ruby worker ... I'll try to reproduce and add more details if I can 🤞
- 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)
I'll need to look into our app and see if some specific action is slower than normal
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 ...