Solana: CPU Utilization On v1.3.N Stair-Steps Upwards

Created on 17 Sep 2020  路  16Comments  路  Source: solana-labs/solana

Problem

CPU Utilization on 1.3 increases in a stair-step fashion until the CPUs are maxed-out. Other validators are seeing the same problem, so I created this issue to hold screenshots & log fragments for debugging.

Most helpful comment

@brianlong super helpful, thanks!

@mvines can you see what send-tx-svc is doing? Or see who should look at that?

All 16 comments

Screen Shot 2020-09-16 at 6 16 31 PM

Screenshot from 2020-09-17 14-29-30
This is a look at htop while running about 50%CPU. I will post another screenshot when CPU % steps up again.

@brianlong super helpful, thanks!

@mvines can you see what send-tx-svc is doing? Or see who should look at that?

Interesting!

@brianlong - are you setup to easily apply patches and rebuild from source? I have a patch at https://github.com/solana-labs/solana/pull/12320 that would be useful to apply to help narrow this down a little more. Happy to wait until we step up more though and need to kill the process. Based on that there might more a little more logging we can add to help debug this more.

My guess right now: you'll see another send-tx-svc thread each time the CPU steps up. I bet some code is panicking and re-creating a new send-tx-svc

@mvines I might need a little coaching, but I'll give it a try this evening.

Pretty sure the bug is in the BankServer's version of the SendTransactionService: https://github.com/solana-labs/solana/blob/9b866d79fb1173d837ad18273a7034ae7fb4fd18/banks-server/src/banks_server.rs#L230
I don't think it will cleanly shut down the SendTransactionService in some cases, which could cause that send-tx-svc thread to spin loop and eat up a CPU.

This would pretty much explain the CPU stepping behavior

@mvines I've done sudo apt install libudev-dev and I still see this error when trying to compile from your fork & dup branch. `` error: failed to run custom build command forhidapi v1.2.3`

Caused by:
process didn't exit successfully: /home/brianlong/solana/target/release/build/hidapi-1e613a883643668a/build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to find libudev: Command { command: ""pkg-config" "--libs" "--cflags" "libudev"", cause: Os { code: 2, kind: NotFound, message: "No such file or directory" } }', /home/brianlong/.cargo/registry/src/github.com-1ecc6299db9ec823/hidapi-1.2.3/build.rs:53:54
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
```
Any suggestions?

@mvines Yes, I now see five threads for send-tx-svc. I think you're on the right track.

@brianlong try installing the full set of system dependencies listed here

@t-nelson Thanks. I am now up & running on the @mvines version of 1.4.0 devbuild. I think I also just sent all of my testnet SOL to Michael ;-)

I'll let this run for a while and report back when I see the CPU step-up.

@mvines It just occurred to me that you might have patched a different branch, not 1.4.0. Do you want me running 1.4.0?

v1.3 would have been better than v1.4 but I think it's ok. Actually it's possible that on both the tip of v1.3 and v1.4/master the issue will no longer reproduce due to another bank_server bug we recently fixed.

But no matter, I'll look at fixing up what looks to be the root cause shortly

I saw your change in the tip of the dup branch, so I ran with it. ;-)

@mvines Here is a look at the threads this morning.

Screen Shot 2020-09-18 at 8 42 17 AM

Ok great, two send-tx-svc threads at ~99% cpu. That fits my theory, thanks Brian!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mvines picture mvines  路  7Comments

carllin picture carllin  路  5Comments

kwunyeung picture kwunyeung  路  8Comments

garious picture garious  路  9Comments

mvines picture mvines  路  3Comments