Pages:
Author

Topic: Are High Disk Writes Expected? (Read 438 times)

member
Activity: 351
Merit: 37
August 02, 2024, 03:15:04 AM
#26
I've never used Electrum server, but I'm curious: what could it possibly be doing that requires so much disk writes?
doesn't electrumx have a log file? why not open it and take a look at what it's doing? maybe it will tell  you when it is doing disk writes and what they are for. any reputable software would.
this guy is paired with moronic mods. this team will not answer
fuck you
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
July 04, 2024, 04:36:29 AM
#25
Between all the Fulcrum variations in the list above, it looks like just under 1 GB was written in 14 hours. In the same timeframe, electrumx would have written around 70 gigabtyes to disk (seemed to average around 5 GB per hour). Crazy difference.

This is interesting discovery. Usually i would suggest people to consider ElectrumX or Fulcrum when they want to run Electrum server, but it'll make me prioritize to recommend Fulcrum instead.

There are three possible causes I can think of for now:

1. I have electrumx misconfigured somehow. If other people were observing this, then this is probably not the true. However, nobody else running electrumx reported back to me, so I have no evidence that this is true.

If you strictly follow the guide, i think it means ElectrumX have default poor configuration rather you misconfigured ElectrumX.
newbie
Activity: 15
Merit: 35
July 03, 2024, 11:38:44 AM
#24
I think I'm just going to use Fulcrum. It's working well, and these results are promising. I have been running iotop for about 14 hours now (first column is cumulative disk writes, second column is process name):

Code:
506.94 M bitcoin-qt -min -chain=main [b-qt-init]
466.48 M systemd-journald
362.11 M Fulcrum /home/user/Desktop/fulcrum/fulcrum-user-config.conf [rocksdb:low]
244.21 M Fulcrum /home/user/Desktop/fulcrum/fulcrum-user-config.conf [Controller]
223.21 M bitcoin-qt -min -chain=main [b-scheduler]
212.82 M Fulcrum /home/user/Desktop/fulcrum/fulcrum-user-config.conf [rocksdb:high]
167.34 M bitcoin-qt -min -chain=main [b-msghand]
166.64 M tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0
157.10 M [jbd2/sda2-8]
 94.43 M Fulcrum /home/user/Desktop/fulcrum/fulcrum-user-config.conf [rocksdb:low]
 25.96 M rsyslogd -n -iNONE [rs:main Q:Reg]
 10.98 M fwupd
  4.83 M Fulcrum /home/user/Desktop/fulcrum/fulcrum-user-config.conf
  4.27 M Fulcrum /home/user/Desktop/fulcrum/fulcrum-user-config.conf
972.00 K bitcoin-qt -min -chain=main [b-addcon]
216.00 K smartd -n
176.00 K snapd
124.00 K bitcoin-qt -min -chain=main [b-opencon]

Between all the Fulcrum variations in the list above, it looks like just under 1 GB was written in 14 hours. In the same timeframe, electrumx would have written around 70 gigabtyes to disk (seemed to average around 5 GB per hour). Crazy difference.

There are three possible causes I can think of for now:

1. I have electrumx misconfigured somehow. If other people were observing this, then this is probably not the true. However, nobody else running electrumx reported back to me, so I have no evidence that this is true.
2. Some of the code is poorly implemented somewhere or there is a bug in electrumx. I also have no evidence for this.
3. This is a difference between leveldb and rocksdb. I only tested electrumx with leveldb. Fulcrum uses rocksdb. Each of these simply may handle things differently. It's possible I wouldn't observe this if I used electrumx with rocksdb instead.

At this point, I'm not really willing to sink any more time into this to get to the root cause, since Fulcrum is working great. I'm just going to continue using it for now.

Thanks for your help, everyone.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
July 03, 2024, 04:13:33 AM
#23
I've never used Electrum server, but I'm curious: what could it possibly be doing that requires so much disk writes?
doesn't electrumx have a log file? why not open it and take a look at what it's doing? maybe it will tell  you when it is doing disk writes and what they are for. any reputable software would.

Yes, it create log file. But based on previous discussion and example on https://electrumx.readthedocs.io/en/latest/HOWTO.html#understanding-the-logs, i expect bunch of these which isn't very helpful.

Code:
INFO:BlockProcessor:flushed to FS in 0.3s
INFO:BlockProcessor:flushed history in 13.4s for 934,933 addrs
INFO:BlockProcessor:flushed 6,403 blocks with 5,879,440 txs, 2,920,524 UTXO adds, 3,646,572 spends in 93.1s, committing...

But if you or someone else know how to make ElectrumX perform flush less frequently, it probably can reduce it's write activity.
sr. member
Activity: 1190
Merit: 469
July 02, 2024, 11:34:06 PM
#22
I've never used Electrum server, but I'm curious: what could it possibly be doing that requires so much disk writes?
doesn't electrumx have a log file? why not open it and take a look at what it's doing? maybe it will tell  you when it is doing disk writes and what they are for. any reputable software would.
newbie
Activity: 15
Merit: 35
July 02, 2024, 09:40:16 AM
#21
not very much RAM was being used according to Xubuntu's built-in task manager
Did you miss this part?
The other memory is not empty, it's probably in use as file cache.

and when I put in 16 GB instead of 8 GB of RAM, I noticed absolutely no difference.
No difference in memory usage, or no difference in disk writes? I guess it depends on what your Electrum server is doing: Bitcoin Core would benefit from larger dbcache, I don't know anything about Electrum server.

Quote
I highly doubt the processor would impact the amount of disk writes.
Agreed.

Both. I wasn't seeing any difference in the RAM usage or any difference in the disk writes when using 16 GB of RAM relative to 8 GB, even after increasing the dbcache in Bitcoin Core and the CACHE_MB in electrumx.

Also, Fulcrum finally fully finished indexing/processing all the blocks, so I'll let it run for a couple hours and monitor the disk writes. It will be interesting to compare to electrumx.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
July 02, 2024, 02:13:22 AM
#20
not very much RAM was being used according to Xubuntu's built-in task manager
Did you miss this part?
The other memory is not empty, it's probably in use as file cache.

and when I put in 16 GB instead of 8 GB of RAM, I noticed absolutely no difference.
No difference in memory usage, or no difference in disk writes? I guess it depends on what your Electrum server is doing: Bitcoin Core would benefit from larger dbcache, I don't know anything about Electrum server.

Quote
I highly doubt the processor would impact the amount of disk writes.
Agreed.
newbie
Activity: 15
Merit: 35
July 02, 2024, 01:43:25 AM
#19
1tb ssd
32gb ram
I5 8500  or newer

using the Celeron and 8gb ram is simply a shit show.


I have run a ton of different  wallets in fact I will be doing a new one as I now have 1 gb  vs my old internet



I'm not sure about this. As I mentioned, not very much RAM was being used according to Xubuntu's built-in task manager, and when I put in 16 GB instead of 8 GB of RAM, I noticed absolutely no difference. I highly doubt the processor would impact the amount of disk writes.

Once again, it's not like the performance is bad; it's actually been entirely sufficient for me. I just can't figure out why ElectrumX is writing so much to disk. This very well could simply be how it was designed, and everybody, regardless of hardware, would experience this.
legendary
Activity: 4326
Merit: 8914
'The right to privacy matters'
July 01, 2024, 05:07:32 PM
#18
1tb ssd
32gb ram
I5 8500  or newer

using the Celeron and 8gb ram is simply a shit show.


I have run a ton of different  wallets in fact I will be doing a new one as I now have 1 gb  vs my old internet

newbie
Activity: 15
Merit: 35
June 30, 2024, 10:19:28 AM
#17
I'm giving Fulcrum a try right now. The database is currently building. It uses rocksdb while electrumx (by default) used leveldb, so maybe the write activity will be different. I will report back once it's all finished.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
June 30, 2024, 04:00:41 AM
#16
At the moment I cannot find any settings to change for electrumx that would lower the disk writes. As a temporary solution for now I'm thinking I might use an extra 2.5 inch HDD from one of my old laptops and dedicate it to just the electrumx db folder (this is where all the writes are happening) so I can keep it separate from the SSD the OS and Bitcoin Core are installed on. Obviously performance will be worse but I'm not sure it will be bad enough to really matter for me. Either that or I will use a much cheaper extra 256 GB SSD instead.

Using HDD seems to be poor choice. If i were you, i would try different Electrum server implementation such as Fulcrum or Electrs. Sparrow Wallet developer even write a benchmark about it on https://www.sparrowwallet.com/docs/server-performance.html.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
June 30, 2024, 01:38:35 AM
#15
As a temporary solution for now I'm thinking I might use an extra 2.5 inch HDD from one of my old laptops and dedicate it to just the electrumx db folder (this is where all the writes are happening) so I can keep it separate from the SSD the OS and Bitcoin Core are installed on. Obviously performance will be worse but I'm not sure it will be bad enough to really matter for me. Either that or I will use a much cheaper extra 256 GB SSD instead.
I wouldn't move the writes to a HDD. That's terrible for performance. Note that cheap SSDs are usually lower quality, both in endurance as well as performance. I'd just let it be, keep backups of the data, and by the time your SSD is "worn" in a few years, replace it with a bigger one.
newbie
Activity: 15
Merit: 35
June 29, 2024, 09:02:12 AM
#14
At the moment I cannot find any settings to change for electrumx that would lower the disk writes. As a temporary solution for now I'm thinking I might use an extra 2.5 inch HDD from one of my old laptops and dedicate it to just the electrumx db folder (this is where all the writes are happening) so I can keep it separate from the SSD the OS and Bitcoin Core are installed on. Obviously performance will be worse but I'm not sure it will be bad enough to really matter for me. Either that or I will use a much cheaper extra 256 GB SSD instead.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
June 29, 2024, 03:55:57 AM
#13
Edit: Here's what I'm seeing after one hour:

Disk Writes          Command
8.49 G                 python3 /home/user/Desktop/electrumx/electrumx_server
56.66 M               [jdb2/sda2-8]
23.80 M               systemd-journald
20.05 M               bitcoin-qt -min -chain=main [b-msghand]
16.27 M               bitcoin-qt -min -chain=main [b-scheduler]
13.89 M               tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0

Assuming the output comes after you use 16GB RAM and set higher dbcache value, it's not surprising since Bitcoin Core would use disk less frequently. I saw you asked on GitHub whether changing CACHE_MB value may solve the problem. But description under CACHE_MB also mention ElectrumX write something called "unflushed history" frequently which doesn't seem could be changed.

say monero clearly stated that their node will ruin ssd. i'll rather go with sas hba and sas hdd. used sas1 is cheap now, it's enterprise-grade things.

I recall their node software also recommends using SSD if you store the data on HDD. Although i don't know if they still show that recommendation today.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
June 29, 2024, 02:45:29 AM
#12
Edit: Here's what I'm seeing after one hour:

Disk Writes          Command
8.49 G                 python3 /home/user/Desktop/electrumx/electrumx_server
I've never used Electrum server, but I'm curious: what could it possibly be doing that requires so much disk writes?

say monero clearly stated that their node will ruin ssd.
This has nothing to do with Monero.
member
Activity: 351
Merit: 37
June 29, 2024, 01:09:12 AM
#11
say monero clearly stated that their node will ruin ssd. i'll rather go with sas hba and sas hdd. used sas1 is cheap now, it's enterprise-grade things.

Funny you say that because the electrumx devs specifically recommended using an SSD. (As I pointed out above, it's electrumx that is doing all the disk writes, not Bitcoin Core.)
and that's after he'd checked out factory specs. hopeless case
newbie
Activity: 15
Merit: 35
June 29, 2024, 12:16:41 AM
#10
say monero clearly stated that their node will ruin ssd. i'll rather go with sas hba and sas hdd. used sas1 is cheap now, it's enterprise-grade things.

Funny you say that because the electrumx devs specifically recommended using an SSD. (As I pointed out above, it's electrumx that is doing all the disk writes, not Bitcoin Core.)
member
Activity: 351
Merit: 37
June 28, 2024, 10:46:41 PM
#9
say monero clearly stated that their node will ruin ssd. i'll rather go with sas hba and sas hdd. used sas1 are cheap now as  are sas2 hdd's, it's enterprise-grade things.
by hba i mean raid card flashed to IT mode (it'll be LSI one most probably). Because if it's not flashed already you'll need to do this https://www.reddit.com/r/DataHoarder/comments/lck2ou/comment/gm93zpp/      on your own.
newbie
Activity: 15
Merit: 35
June 28, 2024, 09:38:40 AM
#8
Do these disk write numbers seem reasonable to you, or are these way too high?

At a glance, i find it's reasonable since you only have 8GB of RAM when current UTXO size is about 11.6GB according to https://statoshi.info/d/000000009/unspent-transaction-output-set and you need to share with both OS and ElectrumX. But for starter, you probably want to run iotop --accumulated and wait for few days to know which process perform most write.

Here's my findings: on a standard pruned Bitcoin Core (so no txindex I guess, and no ElectrumX) with only 8 GB of RAM, my SSD wrote just under 5 TB for the entire IBD.
It looks like you're writing a lot more than that.

In addition, according to Jameson Lopp benchmark, the write is much lower if you have much bigger RAM and configure Bitcoin Core to use lots of RAM. Although his benchmark doesn't enable txindex either.

Bitcoin Core 26.0

The full sync used:

    16.7 GB RAM
    60 MB disk reads
    561 GB disk writes

Thanks for suggesting iotop. I've been running it for about 10 minutes and I already get the impression electrumx is doing all the disk writes, not even Bitcoin core. After just 10 minutes I'm seeing:

Disk Writes          Command
3.36 G                 python3 /home/user/Desktop/electrumx/electrumx_server
17.97 M               [jdb2/sda2-8]
6.52 M                 systemd-journald
3.84 M                 bitcoin-qt -min -chain=main [b-scheduler]
3.75 M                 bitcoin-qt -min -chain=main [b-msghand]
3.36 M                 tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0

So it's almost certainly my elecrumx configuration I'll need to scrutinize, not Bitcoin core.

Edit: Here's what I'm seeing after one hour:

Disk Writes          Command
8.49 G                 python3 /home/user/Desktop/electrumx/electrumx_server
56.66 M               [jdb2/sda2-8]
23.80 M               systemd-journald
20.05 M               bitcoin-qt -min -chain=main [b-msghand]
16.27 M               bitcoin-qt -min -chain=main [b-scheduler]
13.89 M               tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
June 28, 2024, 08:58:04 AM
#7
I'm getting the impression that adding more RAM mostly reduces disk writes before the node is fully synced, not after.
Each new block requires verification, which includes reading and writing to chainstate.

Quote
But I have extra RAM and I can bump it up to 16GB so I can give it a shot. The Celeron supports up to 64 GB of RAM
Usually the mainboard is the limiting factor.

Quote
Code:
dbcache=12288
With 16 GB RAM, that doesn't leave much for the rest of your OS. I'd go for no more than half your RAM, so try 8 GB dbcache if you install 16 GB RAM.

Quote
Is that the only thing I need to change? Or are there other settings I should try too?
That should be enough. For what it's worth: my system has 16 GB RAM (and the mainboard can't handle more), and during IDB I increase dbcache, but when normally running I reduce it to 1024 again. I don't want Bitcoin Core to occupy the majority of my RAM, I need it for other things.
I just checked: I've written 7.5 TB in the past year (I didn't do a new IBD on it). That's 21 GB written per day, for Bitcoin Core, swap and everything else running on my system. I keep chainstate on this SSD, and blocks on my HDD. At this rate, I'll reach my SSD's rated writes after 80 years.
Pages:
Jump to: