Open darknight7 opened 3 years ago
any update on this ? my node sync less than 20blocks per minute
I don't have an immediate solution. However we have used to see similar problems in the past, and it was solved by adding the following command line flag to the full node:
--state-cache-size 671088640 --db-cache 2048 --max-runtime-instances 16
However, we have also seen significant performance regression after the upgrade of jsonrpsee
. We haven't done any performance test so far. So probably it's worth it to create a benchmark suite and run it with the CI.
Re. this issue, could you help check the following?
The node flags are correct.
A quick note: I would run pherry on the same machine with the node but I'd need to run one copy for each miner, right? I have setup one pherry for testing and will report its performance. I can't run pruntime on the node machine, it's not sgx capable. Can't run the bridge either due to other reasons otherwise I would.
Thanks for the support so far. I'll add the results of the pherry running locally on the full node machine tomorrow, it doesn't look any faster right now. For some reason it started only a bit behind where it was before. This suggests that the status is actually saved in pruntime and pherry is just a "middleman"? If so, then my proposal about saving pherry status should be modified: pruntime should save its sync status on a clean exit instead to avoid starting over.
Hmmm. I think there's one more thing to try: I assume you run the full node on one computer, and pherry + pruntime on the worker computer. Could you try to move one pherry from the worker to the full node host? It may distinguish if the slowness was introduced by the ws connection (node - pherry) or the http connection (pherry - pruntime).
Hi, i am running solo mining, what to check and update? As more than 48hrs after restart, still less than 20blocks /per minute.
Ok, after ~36 hours of pherry running on the same host with the full node (on behalf of just one pruntime of course) there's maybe a slight improvement, but nothing substantial. Of course I can (with time) setup a full stack (node+pherry+pruntime) on one of the machines currently running pruntime to see if it makes a difference but I need to swap discs to have more storage space etc. I can try and put the node on more powerful hardware, it will again take some time. Still, before the upgrade even a 4 core nuc could sync very, very much faster, with pruntime mining simultaneously. Granted, the nuc is very recent hardware, the 4 core running node now is older, but it's a desktop cpu, not a low power one. A log snippet, as you can see speed has not changed much as far as I can tell.
pherry-hez | [2021-11-07T13:14:01Z INFO pherry] get_block (w/changes): Got block Some(199147) hash 0xba89…0557
pherry-hez | [2021-11-07T13:14:06Z INFO pherry] get_block (w/changes): Got block Some(199148) hash 0xe440…c281
pherry-hez | [2021-11-07T13:14:13Z INFO pherry] get_block (w/changes): Got block Some(199149) hash 0x48d2…b3cc
pherry-hez | [2021-11-07T13:14:15Z INFO pherry] get_block (w/changes): Got block Some(199150) hash 0x30a1…3812
pherry-hez | [2021-11-07T13:14:18Z INFO pherry] get_block (w/changes): Got block Some(199151) hash 0x4524…546e
pherry-hez | [2021-11-07T13:14:20Z INFO pherry] get_block (w/changes): Got block Some(199152) hash 0x109b…d278
pherry-hez | [2021-11-07T13:14:21Z INFO pherry] get_block (w/changes): Got block Some(199153) hash 0x60d0…73c4
pherry-hez | [2021-11-07T13:14:22Z INFO pherry] get_block (w/changes): Got block Some(199154) hash 0x882d…9197
pherry-hez | [2021-11-07T13:14:22Z INFO pherry] get_block (w/changes): Got block Some(199155) hash 0xd825…2cf7
pherry-hez | [2021-11-07T13:14:23Z INFO pherry] get_block (w/changes): Got block Some(199156) hash 0xd39e…8718
pherry-hez | [2021-11-07T13:14:23Z INFO pherry] get_block (w/changes): Got block Some(199157) hash 0xe218…ef0f
pherry-hez | [2021-11-07T13:14:24Z INFO pherry] get_block (w/changes): Got block Some(199158) hash 0x3508…93a8
pherry-hez | [2021-11-07T13:14:29Z INFO pherry] get_block (w/changes): Got block Some(199159) hash 0x8b01…2852
pherry-hez | [2021-11-07T13:14:30Z INFO pherry] get_block (w/changes): Got block Some(199160) hash 0x6d3e…482f
pherry-hez | [2021-11-07T13:14:35Z INFO pherry] get_block (w/changes): Got block Some(199161) hash 0xa3bd…dbf6
pherry-hez | [2021-11-07T13:14:39Z INFO pherry] get_block (w/changes): Got block Some(199162) hash 0xc017…82bf
pherry-hez | [2021-11-07T13:14:43Z INFO pherry] get_block (w/changes): Got block Some(199163) hash 0x2495…1d06
pherry-hez | [2021-11-07T13:14:45Z INFO pherry] get_block (w/changes): Got block Some(199164) hash 0x96c6…fa62
pherry-hez | [2021-11-07T13:14:50Z INFO pherry] get_block (w/changes): Got block Some(199165) hash 0x3e77…9930
pherry-hez | [2021-11-07T13:14:53Z INFO pherry] get_block (w/changes): Got block Some(199166) hash 0xdd03…fb81
pherry-hez | [2021-11-07T13:14:56Z INFO pherry] get_block (w/changes): Got block Some(199167) hash 0x52ae…afec
pherry-hez | [2021-11-07T13:14:57Z INFO pherry] get_block (w/changes): Got block Some(199168) hash 0xf4dc…fd9b
pherry-hez | [2021-11-07T13:15:01Z INFO pherry] get_block (w/changes): Got block Some(199169) hash 0xf79f…b782
pherry-hez | [2021-11-07T13:15:04Z INFO pherry] get_block (w/changes): Got block Some(199170) hash 0xb3e1…df04
pherry-hez | [2021-11-07T13:15:09Z INFO pherry] get_block (w/changes): Got block Some(199171) hash 0xfb25…2076
pherry-hez | [2021-11-07T13:15:14Z INFO pherry] get_block (w/changes): Got block Some(199172) hash 0xe497…b35b
pherry-hez | [2021-11-07T13:15:16Z INFO pherry] get_block (w/changes): Got block Some(199173) hash 0x19e3…0cfe
pherry-hez | [2021-11-07T13:15:24Z INFO pherry] get_block (w/changes): Got block Some(199174) hash 0x0397…7dd1
pherry-hez | [2021-11-07T13:15:28Z INFO pherry] get_block (w/changes): Got block Some(199175) hash 0xe963…9894
pherry-hez | [2021-11-07T13:15:33Z INFO pherry] get_block (w/changes): Got block Some(199176) hash 0xee26…5f9a
pherry-hez | [2021-11-07T13:15:37Z INFO pherry] get_block (w/changes): Got block Some(199177) hash 0xb173…0886
pherry-hez | [2021-11-07T13:15:39Z INFO pherry] get_block (w/changes): Got block Some(199178) hash 0xc571…9377
pherry-hez | [2021-11-07T13:15:44Z INFO pherry] get_block (w/changes): Got block Some(199179) hash 0x288a…5c4e
pherry-hez | [2021-11-07T13:15:47Z INFO pherry] get_block (w/changes): Got block Some(199180) hash 0xa020…2455
pherry-hez | [2021-11-07T13:15:49Z INFO pherry] get_block (w/changes): Got block Some(199181) hash 0x2ca7…a34a
pherry-hez | [2021-11-07T13:15:54Z INFO pherry] get_block (w/changes): Got block Some(199182) hash 0x269c…a365
pherry-hez | [2021-11-07T13:15:59Z INFO pherry] get_block (w/changes): Got block Some(199183) hash 0x5dd5…ed0d
I'm wondering if this could be a local problem but I can't imagine the reason. No one else reported anything except me and investoppo above?
@h4x3rotab
However, we have also seen significant performance regression after the upgrade of jsonrpsee. We haven't done any performance test so far. So probably it's worth it to create a benchmark suite and run it with the CI.
You mean https://github.com/paritytech/jsonrpc/ right? If you find a regression please report it, so we know :)
Sorry guys. We are run out of the resource. Now focusing on #500. When it's done we will get back to invest more on this problem.
@niklasad1 Thanks. I'd love to take a closer look later and will definitely get back to you when got any finding.
No pressure at all, definitely lower priority than #500 meanwhile I made another test: moved the node on a 8 vcpu vm: khala and kusama sync was FAST but regarding pherry sync no significant performance increase unfortunately :/
I've made the last missing test: vanilla solo mining with all three containers running on a single machine as they used to in the beginning. Again no noticeable difference. Now I feel I've done my part properly. :)
still no finding ? my two solo mining CPU are still slow in sync .. believe has been 12-days and still not fully sync. decided to stop 1 CPU.. hope it solve (low chance)
@investoppo by any chance: is your /var/khala-dev-node on a mechanical HDD?
I can't make a test to prove this theory until I buy a new large SSD but I think this is what happened: when the last emergency patch was released my 512GB disks were choking, so I moved the node on the only hardware I had, a mechanical hdd that I put in a usb3 enclosure. Plenty of bandwidth but... maybe critically slow seek times unable to keep up with requests.
I had this epiphany this morning, having put one of the miners in my home network to see what would happen. I left it syncing during the night and haven't even logged in until now but when I woke up I clearly heard the HDD struggling under heavy seek load. This may be the reason for this whole issue but I can't prove it right now.
The bandwidth is not a problem. HDD will make a very large latency. Not sure if USB makes it worse, but the random access is critical when syncing the node.
i am not using external HDD (via USB), but not SSD also. I doubt HDD is the problem, as it was working fine since beginning. Issue only happen after last update. Seriously doubt why only we encounter this issue but not for others.
What I can tell is that leaving everything else intact now with the blockchain data on SSD the logs look like this:
phala-pherry | [2021-11-18T09:04:11Z INFO pherry] get_block (w/changes): Got block Some(437930) hash 0xca6d…57c8
phala-pherry | [2021-11-18T09:04:12Z INFO pherry] get_block (w/changes): Got block Some(437931) hash 0xbd94…a396
phala-pherry | [2021-11-18T09:04:12Z INFO pherry] get_block (w/changes): Got block Some(437932) hash 0xfdcb…f8c6
phala-pherry | [2021-11-18T09:04:13Z INFO pherry] get_block (w/changes): Got block Some(437933) hash 0xc3b4…fc94
phala-pherry | [2021-11-18T09:04:13Z INFO pherry] get_block (w/changes): Got block Some(437934) hash 0xb176…c3c2
phala-pherry | [2021-11-18T09:04:13Z INFO pherry] get_block (w/changes): Got block Some(437935) hash 0xefeb…be23
phala-pherry | [2021-11-18T09:04:14Z INFO pherry] get_block (w/changes): Got block Some(437936) hash 0x8bf9…6dc0
phala-pherry | [2021-11-18T09:04:14Z INFO pherry] get_block (w/changes): Got block Some(437937) hash 0x7133…dc00
phala-pherry | [2021-11-18T09:04:14Z INFO pherry] get_block (w/changes): Got block Some(437938) hash 0xc4c9…d798
phala-pherry | [2021-11-18T09:04:15Z INFO pherry] get_block (w/changes): Got block Some(437939) hash 0x58c7…cd9b
phala-pherry | [2021-11-18T09:04:15Z INFO pherry] get_block (w/changes): Got block Some(437940) hash 0x229c…3d2d
phala-pherry | [2021-11-18T09:04:16Z INFO pherry] get_block (w/changes): Got block Some(437941) hash 0xe085…227a
phala-pherry | [2021-11-18T09:04:16Z INFO pherry] get_block (w/changes): Got block Some(437942) hash 0x2101…8f93
phala-pherry | [2021-11-18T09:04:17Z INFO pherry] get_block (w/changes): Got block Some(437943) hash 0x21da…281b
phala-pherry | [2021-11-18T09:04:17Z INFO pherry] get_block (w/changes): Got block Some(437944) hash 0xa77d…0920
phala-pherry | [2021-11-18T09:04:17Z INFO pherry] get_block (w/changes): Got block Some(437945) hash 0x6b3b…33d7
phala-pherry | [2021-11-18T09:04:18Z INFO pherry] get_block (w/changes): Got block Some(437946) hash 0x2895…f90d
phala-pherry | [2021-11-18T09:04:18Z INFO pherry] get_block (w/changes): Got block Some(437947) hash 0x72e7…28f6
phala-pherry | [2021-11-18T09:04:19Z INFO pherry] get_block (w/changes): Got block Some(437948) hash 0x8268…cd71
phala-pherry | [2021-11-18T09:04:19Z INFO pherry] get_block (w/changes): Got block Some(437949) hash 0x39c7…0f0f
phala-pherry | [2021-11-18T09:04:20Z INFO pherry] get_block (w/changes): Got block Some(437950) hash 0xd1f1…575b
phala-pherry | [2021-11-18T09:04:20Z INFO pherry] get_block (w/changes): Got block Some(437951) hash 0xb456…9347
Honestly not as fast as I'd want it to be, still it's an order of magnitude faster than before. Based on this I would also recommend adding a serious warning about using HDDs to store the blockchain in the documentation.
I am experiencing an extremely slow sync speed in pherry, if you need further details just ask, I try to put all relevant information in this first post.
1) node is running on a standalone 4-core machine, cpu usage never goes over 400% so it looks fine to me, connection is gigabit and 2 out of 3 pherries displaying the problem are in lan 2) relevant section of docker-compose.yml
3) the images I'm running look fine to me
4) some of the logs, in the beginning it was FAR slower, like one block in 10 seconds or less, but I thought it was just the whole network coming back after the update
5) sudo docker-compose ps