Open prashb94 opened 5 years ago
@prashb94 size of db is normal, IIRC it can go up to 700+GB before it compacts back down (to 495GB, excluding bitocoind, if we include that total disk requirements, once compacted is around 765GB, but you will need more for the initial run).
How much ram do you have on the machine you run this? What OS/distro?
Thanks! It's on a t3.xlarge EC2 instance (4vCPU/16GB RAM) and attached 2TB of block storage. So memory isn't the issue. Any idea what could be causing it to crash?
Edit: OS - Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-1088-aws x86_64)
@prashb94 I am not too sure but I think this depends on the OS configuration. You may solve the issue by changing /etc/security/limits.conf see https://github.com/romanz/electrs/issues/28 as a similar issue but from https://github.com/romanz/electrs/issues/11 it appears it could also be related to a corrupted bitcoind block file.
Are you using any ad-hoc configuration for bitcoindd? Is the storage ssd?
Thanks
Running into same issue, does not seem to be OS config (or maybe I'm missing something?)
Trace (with RUST_BACKTRACE=full
). NB: This occurred on the first run of the service after a reboot.
Only non-comment line in /etc/sysctl.conf
: fs.file-max = 500000
Only non-comment lines in /etc/security/limits.conf
:
* soft nofile 100000
* hard nofile 100000
Seeing the same problem here. I got an interesting result when I deleted the cache
directory and re-ran electrs: it tried opening a socket to listen from the server and produced a "too many open files" error, but the output message had fd: 1023
in the socket error. This hints at a 1024 fd limit for the process somehow. I upped the hard and soft limits on the machine to 500k and double-checked across all users. Somehow electrs did not have access to that limit.
Upstream electrs is setting the open files limit manually.
Relevant lines in my logs. I guess the error happened when trying to connect to Bitcoind (port 8332)
Dec 11 06:59:50 - esplora-electrs[28090]: 2019-12-11T06:59:50.344+00:00 - ERROR - server failed: Error: failed to clone TcpStream { addr: V4(127.0.0.1:3000), peer: V4(127.0.0.1:8332), fd: 1023 }
Dec 11 06:59:50 - esplora-electrs[28090]: Caused by: Too many open files (os error 24)
The issue on my system turned out to be caused by systemd overriding system wide limits with a "sane" default. Was resolved by setting LimitNOFILE
with a higher value in the electrs
service file.
Here's how I got around this on the command line:
sudo prlimit --nofile=65536 sudo -u "$(id -u)" -g "$(id -g)" cargo blah blah wtv
The first sudo makes us root and gives us access to modify file limits, the second sudo brings us back to our original user to execute cargo
properly
The issue on my system turned out to be caused by systemd overriding system wide limits with a "sane" default. Was resolved by setting
LimitNOFILE
with a higher value in theelectrs
service file.
@setpill Excellent, thanks! Running via systemd here.
Might be nice to make a note of this in the docs 😉
Electrs new-index works fine for testnet but while syncing mainnet, errors out with -
(Truncated log)
Also, the size of
./db
is ~325GB. Is this normal?