HTTP 502: Whoops, GitLab is taking too much time to respond. Even after Server restart

When trying to just login I get

“HTTP 502: Whoops, GitLab is taking too much time to respond. Even after Server restart”

This happened often in the past. Restarting gitlab or the complete server solved that issue.
But now this does not help anymore. The server is 50% idle, two processes from command bundle
are taking 100% of a complete core.

gitlab.rb: https://pastebin.com/ZzsNe0f7

top -d:

Tasks: 78 total, 3 running, 74 sleeping, 0 stopped, 1 zombie
%Cpu(s): 38.7 us, 12.0 sy, 0.0 ni, 49.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 4194304 total, 638408 used, 3555896 free, 0 buffers
KiB Swap: 0 total, 0 used, 0 free. 103228 cached Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2691 git 20 0 329160 139540 7284 R 100.3 3.3 0:12.62 bundle
2754 git 20 0 144420 34756 2800 R 99.3 0.8 0:02.29 bundle

Did you look at the logs? Try grep through log files for “502”.
FYI, I’ve found version 8.17.x to be better in performance compared to other revisions 8.x and versions 9.x