PurpleI2P / i2pd

🛡 I2P: End-to-End encrypted and anonymous Internet
https://i2pd.website
BSD 3-Clause "New" or "Revised" License
3.29k stars 424 forks source link

High RAM (~16GB) and abnormal CPU usage (3.1%) usage #2098

Open sang-shelton opened 2 months ago

sang-shelton commented 2 months ago

I have been running i2pd for like 13 hours, and suddenly i started seeing elevated CPU usage and huge RAM allocation (~16GB). How can i see the logs to know what happened ?

i2pd is running as system service on my device.

System info

``` System: Kernel: 6.10.6-10-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 14.2.1 clocksource: tsc avail: hpet,acpi_pm parameters: BOOT_IMAGE=/boot/vmlinuz-6.10-x86_64 root=UUID=d37c6e4a-949c-4370-8055-0f9e011a3409 rw quiet cryptdevice=UUID=99cf4234-a381-4eff-9a33-abb366e019d2:luks-99cf4234-a381-4eff-9a33-abb366e019d2 root=/dev/mapper/luks-99cf4234-a381-4eff-9a33-abb366e019d2 splash resume=/dev/mapper/luks-97e9302e-784a-4db6-a839-80af7dbb8188 udev.log_priority=3 Desktop: KDE Plasma v: 6.0.5 tk: Qt v: N/A wm: kwin_x11 with: krunner dm: SDDM Distro: Manjaro base: Arch Linux Machine: Type: Desktop Mobo: Micro-Star model: MAG B550 TOMAHAWK MAX WIFI (MS-7C91) v: 1.0 serial: uuid: be5679e8-c7c8-c813-a8b1-047c16beaab1 UEFI: American Megatrends LLC. v: 2.60 date: 10/10/2023 CPU: Info: model: AMD Ryzen 9 5950X socket: AM4 bits: 64 type: MT MCP arch: Zen 3+ gen: 3 level: v3 note: check built: 2022 process: TSMC n6 (7nm) family: 0x19 (25) model-id: 0x21 (33) stepping: 2 microcode: 0xA20120E Topology: cpus: 1x dies: 1 clusters: 1 cores: 16 threads: 32 tpc: 2 smt: enabled cache: L1: 1024 KiB desc: d-16x32 KiB; i-16x32 KiB L2: 8 MiB desc: 16x512 KiB L3: 64 MiB desc: 2x32 MiB Speed (MHz): avg: 3400 min/max: 2200/5083 boost: enabled base/boost: 3400/5050 scaling: driver: acpi-cpufreq governor: schedutil volts: 1.1 V ext-clock: 100 MHz cores: 1: 3400 2: 3400 3: 3400 4: 3400 5: 3400 6: 3400 7: 3400 8: 3400 9: 3400 10: 3400 11: 3400 12: 3400 13: 3400 14: 3400 15: 3400 16: 3400 17: 3400 18: 3400 19: 3400 20: 3400 21: 3400 22: 3400 23: 3400 24: 3400 25: 3400 26: 3400 27: 3400 28: 3400 29: 3400 30: 3400 31: 3400 32: 3400 bogomips: 217727 Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm Vulnerabilities: Type: gather_data_sampling status: Not affected Type: itlb_multihit status: Not affected Type: l1tf status: Not affected Type: mds status: Not affected Type: meltdown status: Not affected Type: mmio_stale_data status: Not affected Type: reg_file_data_sampling status: Not affected Type: retbleed status: Not affected Type: spec_rstack_overflow mitigation: Safe RET Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW; STIBP: always-on; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not affected Type: srbds status: Not affected Type: tsx_async_abort status: Not affected Graphics: Device-1: NVIDIA GA104 [GeForce RTX 3060] vendor: Micro-Star MSI driver: nvidia v: 550.107.02 alternate: nouveau,nvidia_drm non-free: 550.xx+ status: current (as of 2024-09; EOL~2026-12-xx) arch: Ampere code: GAxxx process: TSMC n7 (7nm) built: 2020-2023 pcie: gen: 4 speed: 16 GT/s lanes: 16 ports: active: none off: DP-2 empty: DP-1,DP-3,HDMI-A-1 bus-ID: 2b:00.0 chip-ID: 10de:2487 class-ID: 0300 Display: unspecified server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2 compositor: kwin_x11 driver: X: loaded: N/A failed: nvidia gpu: nvidia,nvidia-nvswitch display-ID: :0 screens: 1 Screen-1: 0 s-res: 2560x1440 s-dpi: 108 s-size: 602x333mm (23.70x13.11") s-diag: 688mm (27.09") monitors: Monitor-1: DP-2 model: MSI G274QPF serial: built: 2023 res: 2560x1440 dpi: 108 gamma: 1.2 size: 597x336mm (23.5x13.23") diag: 685mm (27") ratio: 16:9 modes: max: 2560x1440 min: 640x480 Monitor-2: Unknown-1 size-res: N/A modes: 1024x768 API: EGL v: 1.5 hw: drv: nvidia platforms: device: 0 drv: nvidia device: 2 drv: swrast surfaceless: drv: nvidia x11: drv: nvidia inactive: gbm,wayland,device-1 API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 550.107.02 glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2 memory: 11.72 GiB API: Vulkan v: 1.3.279 layers: 1 device: 0 type: discrete-gpu name: NVIDIA GeForce RTX 3060 driver: nvidia v: 550.107.02 device-ID: 10de:2487 surfaces: xcb,xlib Audio: Device-1: NVIDIA GA104 High Definition Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 2b:00.1 chip-ID: 10de:228b class-ID: 0403 Device-2: Advanced Micro Devices [AMD] Starship/Matisse HD Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 2d:00.4 chip-ID: 1022:1487 class-ID: 0403 API: ALSA v: k6.10.6-10-MANJARO status: kernel-api with: aoss type: oss-emulator tools: alsactl,alsamixer,amixer Server-1: JACK v: 1.9.22 status: off tools: N/A Server-2: PipeWire v: 1.2.3 status: n/a (root, process) with: 1: pipewire-pulse status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin tools: pactl,pw-cat,pw-cli,wpctl Network: Device-1: MEDIATEK MT7921K Wi-Fi 6E 80MHz driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1 bus-ID: 29:00.0 chip-ID: 14c3:0608 class-ID: 0280 IF: wlo1 state: up mac: Device-2: Realtek RTL8125 2.5GbE vendor: Micro-Star MSI driver: r8169 v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1 port: f000 bus-ID: 2a:00.0 chip-ID: 10ec:8125 class-ID: 0200 IF: enp42s0 state: down mac: IF-ID-1: wgpia0 state: unknown speed: N/A duplex: N/A mac: N/A Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant Bluetooth: Device-1: MediaTek Wireless_Device driver: btusb v: 0.8 type: USB rev: 2.1 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-9:6 chip-ID: 0e8d:0608 class-ID: e001 serial: Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends Drives: Local Storage: total: 1.82 TiB used: 214.06 GiB (11.5%) ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: MSI model: M480 PRO 2TB size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: fw-rev: EIFM80.0 temp: 39.9 C scheme: GPT SMART: yes health: PASSED on: 112d 2h cycles: 289 read-units: 10,276,039 [5.26 TB] written-units: 22,736,828 [11.6 TB] Partition: ID-1: / raw-size: 1.79 TiB size: 1.76 TiB (98.37%) used: 213.84 GiB (11.9%) fs: ext4 block-size: 4096 B dev: /dev/dm-0 maj-min: 254:0 mapped: luks-99cf4234-a381-4eff-9a33-abb366e019d2 ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 448 KiB (0.1%) fs: vfat block-size: 512 B dev: /dev/nvme0n1p1 maj-min: 259:1 Swap: Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: yes compressor: zstd max-pool: 20% ID-1: swap-1 type: partition size: 34.39 GiB used: 227 MiB (0.6%) priority: -2 dev: /dev/dm-1 maj-min: 254:1 mapped: luks-97e9302e-784a-4db6-a839-80af7dbb8188 Sensors: System Temperatures: cpu: 46.5 C mobo: 44.0 C gpu: nvidia temp: 45 C Fan Speeds (rpm): N/A gpu: nvidia fan: 0% Info: Memory: total: 32 GiB available: 31.26 GiB used: 10.17 GiB (32.5%) Processes: 648 Power: uptime: 13h 48m states: freeze,mem,disk suspend: deep avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot, suspend, test_resume image: 12.48 GiB services: org_kde_powerdevil, power-profiles-daemon, upowerd Init: systemd v: 256 default: graphical tool: systemctl Packages: 1582 pm: pacman pkgs: 1532 libs: 400 tools: pamac pm: appimage pkgs: 0 pm: flatpak pkgs: 50 Compilers: clang: 18.1.8 gcc: 14.2.1 Shell: Sudo (sudo) v: 1.9.15p5 default: Bash v: 5.2.32 running-in: konsole inxi: 3.3.36 ```

Vort commented 2 months ago

What exact version of i2pd you are using?

sang-shelton commented 2 months ago

What exact version of i2pd you are using?

i2pd version 2.53.1 (0.9.63)
Boost version 1.83.0
OpenSSL 3.3.1 4 Jun 2024
Vort commented 2 months ago

How can i see the logs to know what happened ?

Maybe sudo journalctl -u i2pd command can help. I have little experience with Linux so I'm not sure.

sang-shelton commented 2 months ago

How can i see the logs to know what happened ?

Maybe sudo journalctl -u i2pd command can help. I have little experience with Linux so I'm not sure.

Sadly i think i didn't find logs about what happened. I think it was a memory leak (C++ blessings 😆).

Vort commented 2 months ago

Did you made something specific with your node during its operation or it was just doing its own things? There should be something which triggered such behaviour. Normally, node uses around 200-300 MB of RAM. So if you find it using even 1 GB next time, please try to track what may have caused it.

sang-shelton commented 2 months ago

Did you made something specific with your node during its operation or it was just doing its own things? There should be something which triggered such behaviour. Normally, node uses around 200-300 MB of RAM. So if you find it using even 1 GB next time, please try to track what may have caused it.

I am just running i2pd to use it with retroshare. it works normally 95% of the time. I will try and track the issue if it happens again

Vort commented 2 months ago

There were many changes made since 2.53.1, you may want to try building binary from source - for example, I use version 2.53.1-99-gd5aca85a right now. Probably this problem was already solved (or maybe more problems were added, who knows).

orignal commented 2 months ago

ulimit -n 4096 before start will solve your problem

sang-shelton commented 2 months ago

ulimit -n 4096 before start will solve your problem

Wont that mess other parts of the system ? My current limit is unlimited

orignal commented 2 months ago

Type ulimit -n and see what you actual limit is. I bet it's 1024. You don't change it systemwide just before start i2pd. ulimit -n 4096 i2pd