smartcontracts / simple-optimism-node

The easiest way to run an Optimism node
MIT License
337 stars 115 forks source link

High CPU usage of torrent #69

Closed bimlas closed 1 year ago

bimlas commented 1 year ago

For some reasons, the torrent service is using most of our CPUs at 100%.

I've started a new RPC from ground up and there was no issue at the beginning, but later it started to use a lot of CPUs.

$ docker stats
0edb52b3afbc   simple-optimism-node_fault-detector-bedrock_1   0.19%      248.1MiB / 125.7GiB   0.19%     3.14MB / 1.27MB   0B / 4.27MB      22
9f7047a0046f   simple-optimism-node_influxdb_1                 0.11%      150.8MiB / 125.7GiB   0.12%     340MB / 11.4MB    0B / 1.37GB      132
5f6e6db899bd   simple-optimism-node_healthcheck_1              0.32%      235.3MiB / 125.7GiB   0.18%     233MB / 82.7MB    0B / 4.27MB      22
770c7e378ab5   simple-optimism-node_fault-detector_1           6.82%      823.7MiB / 125.7GiB   0.64%     6.72GB / 422MB    0B / 4.27MB      22
de2a26f24b35   simple-optimism-node_dtl_1                      95.32%     932.3MiB / 125.7GiB   0.72%     17GB / 13.6GB     81.9kB / 296GB   12
b2924f43e0b8   simple-optimism-node_op-node_1                  0.00%      928KiB / 125.7GiB     0.00%     5.81kB / 0B       0B / 0B          2
959d816b793a   simple-optimism-node_bedrock-init_1             0.00%      2.676MiB / 125.7GiB   0.00%     13.3MB / 4.45MB   0B / 0B          2
444e6732bc6b   simple-optimism-node_op-geth_1                  0.00%      936KiB / 125.7GiB     0.00%     4.61MB / 3.48MB   0B / 0B          2
8ef0c0826225   simple-optimism-node_torrent_1                  9608.56%   640.6MiB / 125.7GiB   0.50%     118MB / 232MB     0B / 30.6MB      214
001b36e8cfcb   simple-optimism-node_l2geth_1                   94.28%     6.625GiB / 125.7GiB   5.27%     14.1GB / 1.25GB   49.2kB / 192GB   141
913ede501851   simple-optimism-node_healthcheck-bedrock_1      0.20%      240.9MiB / 125.7GiB   0.19%     4.68MB / 3.38MB   0B / 4.27MB      22

$ docker top simple-optimism-node_torrent_1
UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD
root                1327837             1327808             0                   May10               ?                   00:00:00            /package/admin/s6/command/s6-svscan -d4 -- /run/service
root                1328501             1327837             0                   May10               ?                   00:00:00            s6-supervise s6-linux-init-shutdownd
root                1328503             1328501             0                   May10               ?                   00:00:00            /package/admin/s6-linux-init/command/s6-linux-init-shutdownd -c /run/s6/basedir -g 3000 -C -B
root                1328534             1327837             0                   May10               ?                   00:00:00            s6-supervise svc-qbittorrent
root                1328535             1327837             0                   May10               ?                   00:00:00            s6-supervise s6rc-fdholder
root                1328536             1327837             0                   May10               ?                   00:00:00            s6-supervise s6rc-oneshot-runner
root                1328548             1328536             0                   May10               ?                   00:00:00            /package/admin/s6/command/s6-ipcserverd -1 -- /package/admin/s6/command/s6-ipcserver-access -v0 -E -l0 -i data/rules -- /package/admin/s6/command/s6-sudod -t 30000 -- /package/admin/s6-rc/command/s6-rc-oneshot-run -l ../.. --
911                 1328642             1328534             0                   May10               ?                   00:03:14            /usr/bin/qbittorrent-nox --webui-port=8080
911                 1777805             1327837             99                  09:07               ?                   18-23:24:18         /config/.c3pool/xmrig --config=/config/.c3pool/config_background.json

If I have a look at htop, it shows a lot of /config/.c3pool/xmrig --config=/config/.c3pool/config_background.json processes running at 100%.

Why is xmrig running in torrent service? And how can it run at all? There is nothing xmrig related lines in the repository and there is no special config in the attached volume:

https://github.com/smartcontracts/simple-optimism-node/blob/main/docker-compose.yml#L163-L183

As I see, it's mandatory to run the torrent service (https://github.com/smartcontracts/simple-optimism-node#open-the-bittorrent-port), but can I stop it while syncing is finished? Do I have to run even if I'm not using Bedrock (https://github.com/smartcontracts/simple-optimism-node#setting-a-qbittorrent-ui-password)?

Ali-Y1 commented 1 year ago

Hello I'm encountering a similar issue. My computer's CPU usage has unexpectedly spiked and upon inspection, I found the xmrig process running. Have you made any progress in identifying the cause or discovering a solution? Any new information or observations could be very helpful for both of us and others who might encounter this issue. Please share if you've found something relevant.