monero-project / monero-gui

Monero: the secure, private, untraceable cryptocurrency
Other
1.73k stars 767 forks source link

Monero GUI Syncing process makes my Linux painfully slow and lagging #4259

Open F3llFr0mTh3Sky opened 9 months ago

F3llFr0mTh3Sky commented 9 months ago

Hello, I'm using the Monero GUI v0.18.3.1 with a local node. image

It was fully synced yesterday, but I kept my PC powered off during the night. The first sync also took more than 24 hours, which downloaded about 170 Gb on my SSD. So now, my node needs to sync again and like for the first time, it makes my Linux painfully slow. By painfully slow, I mean it becomes randomly totally unusable during 1 to 2 minutes: Unability to use, drag and switch between windows. Unability to use the file manager. Internet slowering down. Moving the mouse cursor doesn't works or gets very slow.

It is very strange because I have a fast Samsung 2 Tb SSD, a 16 cores i7-10700K CPU and 32 Gb of Corsair DDR4 RAM. I'm on Linux Kernel 6.1.67-rt20-xanmod1-dist (basically the XanMod kernel mixed with the Gentoo Dist Kernel patches). The filesystem is EXT4 and again it's on a SATA 6 Gb/s Samsung SSD. After the node was synced for the first time, I've been able to use the Monero miner and it didn't slows up my PC.

I think I know the root cause of the issue: I've a 64 Gb SWAP and 32 Gb RAM, but it seems to me the Monero GUI uses ALL of it: image image image image

See that the VIRT usage reports 83 Gb, now its even 84 85 86 87 Gb. I'll double check it but I think it also uses as much RAM after the sync is finished. So basically, memory leaking that fills my SWAP (so the SSD) with a lot of crap and slowering it? I already know that when my SSD is under heavy usage, for some reason it's slowering up a lot the whole OS. This happened for example when I was downloading big files.

In order to help debugging, here's the source code of the install script that compiles the Monero GUI on Gentoo : https://github.com/l29ah/booboo/blob/master/net-p2p/monero-gui/monero-gui-0.18.3.1.ebuild And here's the one for Monero itself: https://github.com/gentoo/guru/blob/master/net-p2p/monero/monero-0.18.3.1.ebuild

Also, knowing my Internet connection is kinda slow: image It is unlikely Monero syncing process should require 88 Gb of RAM and SWAP.

Here's the result of the memory usage of monerod: pmap.txt

I'll need to sync my Monero Node every single day, and so, if the memory leaking bug doesn't fixed, I'll have to endure it and that it would cause a lot of frustration and loss of time.

So yeah, could you please fix your damn buggy software?

selsta commented 9 months ago

With your hardware it should take around 3 minutes to sync up after having your node offline for 24h. Does it take longer than that?

See that the VIRT usage reports 83 Gb, now its even 84 85 86 87 Gb.

Monero uses LMDB, a memory mapped db, that's why it displays 83GB. This is not a memory leak, on my VPS with 16GB RAM it says 196GB VIRT usage, and I have no issues, no swap usage and lot of remaining free RAM.

F3llFr0mTh3Sky commented 9 months ago

With your hardware it should take around 3 minutes to sync up after having your node offline for 24h. Does it take longer than that?

I started the sync at 11:00 AM and at 21:00 PM I gave up because it still wasn't finished and it took way too much time. I guess you proved my point, something wrong it happening on my side. And knowing everything else on my PC runs just fine when MoneroD isn't running, then the issue is with MoneroD.

Also, as I explained MoneroD just does makes my PC unusable. And according to the picture just under the "htop" one, the RAM usage of MoneroD is about 31 Gb.

selsta commented 9 months ago

And knowing everything else on my PC runs just fine when MoneroD isn't running, then the issue is with MoneroD.

You wrote the following which might be related, syncing the blockchain makes heavy use of random read / write on the SSD.

I already know that when my SSD is under heavy usage, for some reason it's slowering up a lot the whole OS.

Did you look into what causes this?

selsta commented 9 months ago

And according to the picture just under the "htop" one, the RAM usage of MoneroD is about 31 Gb.

What does it show under MemAvailable?

F3llFr0mTh3Sky commented 9 months ago

I already know that when my SSD is under heavy usage, for some reason it's slowering up a lot the whole OS.

Did you look into what causes this?

No idea. The only thing I knew is that my SSD was limited to 3 Gb/s by the shit integrated SATA controller of my GigaByte motherboard. Then I moved it to my PCIe ASMedia 1066 SATA controller, which improved the speed up to 6 Gb/s but it didn't solve the issue.

 And according to the picture just under the "htop" one, the RAM usage of MoneroD is about 31 Gb.

What does it show under MemAvailable?

~~Sorry I don't know and I don't want to run MoneroD again until the issue is solved. If I run it it will make my PC unstable.~~ The node has been running since less that 5 minutes and now I'll close it. image

F3llFr0mTh3Sky commented 9 months ago

Actually this time MoneroD strangely only had to sync around 700 blocks : image

selsta commented 9 months ago

There are 720 blocks per day, so if you last opened it around 24h ago it's not strange.

F3llFr0mTh3Sky commented 9 months ago

No it's strange, because earlier today, as you can see on the first picture it wanted to sync over 1 million blocks, but it was originally 2 millions before it started to progress. And that sync didn't finish. This was the second sync and the he first time, it was totally synced.

What I mean is that when a sync gets interrupted, the next time MoneroD is started, it should start to sync where it stopped the last time.