Slow responses and out of memory issues #277
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
hard fork
help wanted
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
soft fork
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
work in progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbrycrd#277
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Just updated to the latest master of lbrycrd a couple days ago, but have not been able to make it stable. Daemon will shutdown after a couple rpc calls to getclaimtrie and/or getblocktemplate, and all calls are generally very slow to execute, espescially getclaimtrie which takes from 60000-80000ms.
Daemon shuts down for apparently no good reason, but every now and then i see
Error: Out of memory. Terminating.
as last entry in log, sometimes its just nothing indicating that the daemon have shut down in the logs.Sometimes getblocktemplate response is
error -1: createnewblock: testblockvalidity failed: bad-claim-merkle-hash (code 16)
which usually is gone within a couple seconds.build: LBRYcrd Core version v0.17.1.0-55f5f2049 (release build)
os: Ubuntu 18.04.1 LTS
Available RAM is above 40GB, Server load is less than 1.
For now i have switched back to release v0.12.4.0 which is stable.
Thanks for opening this issue! Can we show you some appreciation for your time? We'll take a look into this.
We recently merged lots of Bitcoin upstream changes and I'm guessing there are still a few kinks to work out. I'll give it a shot sometime this week also. Would you mind trying to backup your current data (besides wallet) and syncing from scratch to see if that makes a difference? Would be a good test.
We are aware of this issues, hopefully we will merge our work past couple of months, soon. https://github.com/lbryio/lbrycrd/pull/276
@cod3gen , is getclaimtrie in a method that you use often? We had planned to remove that in our next software release. It won't scale. The current RPC framework in lbrycrd (and its bitcoin base) does not allow streaming output; it requires the entire JSON object in RAM.
Since you say you where going to remove it, i had to check what it actually is used for... I operate powermining.pw mining pool, based on yiimp stratum. If claimtrie is missing from getblocktemplate, it will try to retrieve claim hash from getclaimtrie... Which then again seems to dump all claims on chain? No wonder its taking ages to process.. Really not a optimal alternative method which really should have been just removed honestly. But in order to actually request a getclaimtrie, "claimtrie" must be missing from getblocktemplate.. I did not check this before i reverted to the older version, will check this on a backup server to see if there are any changes there.
Excellent explanation; you've pointed out that the claimtrie field is missing in the getblocktemplate return in the current master. That is a definite oversight on our part. I'll get that rectified shortly.
Yeah, started latest version and claimtrie is missing from blocktemplate, so once that`s in place again it most likely work as normal for pool operations. Beside getblocktemplate, what other commands would reveal claimtrie hex?
Also tested a bit more about the out of memory problem.. After 1-3 runs of either getclaimtrie OR getclaimsintrie, will result in daemon crash complaining out of memory. While monitoring ram usage, daemon consumed above 28GB physical memory before it crashed (at the same time lbrcyrd-cli consumed upto 10GB physical memory) which result in close to 40GB memory which was what i had left.. Turning on a larger swap space to compensate makes the daemon "survive" but ends with "error: couldn't parse reply from server" in client..
Will rebuild latest master once a fix have been applied :-)
I don't think there is any other way to get the value you are looking for. getblockheader will includes a field named nameclaimroot that has the value you are looking for on mined data, but not on pre-mined data (which I assume is what you need the block template for).
I also want to confirm that @bvbfan and I were seeing the same behavior where each call to getclaimsintrie or getclaimtrie leaks to RAM the entire return value.
Hey @cod3gen, thanks for pointing out this issue! Can we show you some appreciation?
@cod3gen , the current master now includes the correct data in the getblocktemplate method. You may test it. Be careful, though. We are planning a few more major changes and a lot of testing on it over the next few weeks as we prepare for the next software release. It's not well-tested at the moment. Treat it with alpha status. Don't put any serious money in it. Feel free to report any further issues that you see with it.