neo-modules icon indicating copy to clipboard operation
neo-modules copied to clipboard

Performance Monitor Plugin

Open meevee98 opened this issue 5 years ago • 14 comments

This is a plugin created to monitor some aspects of Neo. The metrics that the plugin measures are the ones discussed in neo#920

meevee98 avatar Mar 03 '20 20:03 meevee98

@meevee98 Gread work! But there are some issues need to be fixed. test commit : 45b10a0 with neo-cli: master e5400583a41bd19d4f2db5e05ca59a6c04160853 neo: master ff850c5e170a8a132132de9aea6168b0668125aa neo-vm: master 754bca3568c50695c571cb796c500fd66c07d0fe

  • block time <index/hash> current block height is 310, result of block time 301, 303 is incorrect.
neo> block time 301
Block Hash: 0x1642a8e70d21a1651cba7fd9f22e4d6d05b69a93fe09119bc753a082db5194f7
      Index: 301
      Time: 127 seconds
neo> block time 302
Block Hash: 0x35716ca313de935d230d6e5959028a98697374918b56743a95c0eeadd7f1f3ad
      Index: 302
      Time: 15 seconds
neo> block time 303
Block Hash: 0x5367caa58473c2d82fdf340d715e9381d612f180fd8cd95f254ee4467072e276
      Index: 303
      Time: 303 seconds
  • When the height increased to 550, block avgtime 550, the result is incorrect.
neo> block avgtime 7
Average time/block: 15.06 seconds
neo> block avgtime 8
Average time/block: 15.06 seconds
neo> block avgtime 9
Average time/block: 15.06 seconds
neo> block avgtime 30
Average time/block: 18.77 seconds
neo> block avgtime 100
Average time/block: 16.76 seconds
neo> block avgtime 101
Average time/block: 16.75 seconds
neo> block avgtime 102
Average time/block: 16.75 seconds
neo> block avgtime 103
Average time/block: 16.75 seconds
neo> block avgtime 104
Average time/block: 16.73 seconds
neo> block avgtime 550
Average time/block: 1112.98 seconds
neo> block avgtime 551
Average time/block: 1112.98 seconds
  • check disk Both on Win10/Ubuntu, check disk return error: Performance counters are not supported on this platform. d36d1e9add92e1713326c5425ddd934

  • check memory on Ubuntu 18.04, check memory return 0.00 MB 1dda5650d024a9a08fb7caeff885f2f

  • tx avgsize [1 - 10000] There are total 2 txs for the test private chain. while tx avgsize 3 is not equal to tx avgsize 2. e7d317ae6d5076df7ab90c95a7bfb7a 416a18157d59af8b6c901d771caed88

  • confirmation time & payload time

always return Timeout.

neo> confirmation time
Waiting for the next commit...
Timeout
neo> confirmation time
Waiting for the next commit...
Timeout
neo> payload time
Waiting for the next payload...
Timeout
  • Network Commands: connected, when current height update, height in the result of "connected" does not update. for example, height is always 578, while getconnectioncount is 580.
neo> connected
Connected nodes: 1
  ip: 127.0.0.1         height: 578

cloud8little avatar Mar 09 '20 09:03 cloud8little

Thank you for your tests @cloud8little

  • block time <index/hash> current block height is 310, result of block time 301, 303 is incorrect.
  • When the height increased to 550, block avgtime 550, the result is incorrect.

I couldn't reproduce, can you give me more details?

  • check disk Both on Win10/Ubuntu, check disk return error: Performance counters are not supported on this platform.

For this to work, you need to add System.Diagnostics.PerformanceCounter as a dependency in neo-cli, otherwise it won't not work, even if you include the dll in the folder. I've added it in neo-node#549

  • confirmation time & payload time always return Timeout.

Confirmation and payload time only work after start consensus, that's why it always returns a timeout. I've changed the printed message to make this condition clearer.

meevee98 avatar Mar 09 '20 20:03 meevee98

@meevee98 hi, I wrote a readme giving the description about the commands of the plugin, as well as some notable points to ease the use. Hope to have your opinion.

bettybao1209 avatar Mar 10 '20 02:03 bettybao1209

@meevee98

  1. you can try "block time 147" in this private chain. block-time-147-incorrect.zip

1fe5287b528270a3ed9aac5e95c6a17

  1. already add this reference. https://github.com/neo-project/neo-node/pull/549, while the result is the same: error: Performance counters are not supported on this platform.

  2. the same chain with 1, you can wait the block height to 170+. dde3afe18b9f116cefcd1f1608b1e69

cloud8little avatar Mar 11 '20 07:03 cloud8little

@meevee98 hi, I wrote a readme giving the description about the commands of the plugin, as well as some notable points to ease the use. Hope to have your opinion.

Thank you for your help @bettybao1209. I think the readme is very good.

  1. you can try "block time 147" in this private chain. block-time-147-incorrect.zip

1fe5287b528270a3ed9aac5e95c6a17

I investigated the problem and I think this is not wrong at all. Using the show block command from this pull request to show the information of the block, we can see that there is a more than 4 minutes gap between the blocks 147 and 148.

image

That's why the result of block time was 270 seconds (4 minutes and 30 seconds). Also, that's why I think it's not the wrong result: this result means that block 148 delayed, so the 147 remained active longer than it should.

  1. the same chain with 1, you can wait the block height to 170+. dde3afe18b9f116cefcd1f1608b1e69

For this, the problem was that some blocks had a much longer time in seconds, increasing the average. I found that these three blocks had a time greater than 4 hours, with the longest between blocks 100 and 101, with a gap of almost 2 days:

image image

Probably that happened because the blockchain was paused and continued later.

I'm still working on the problem with Performance Counter.

meevee98 avatar Mar 11 '20 17:03 meevee98

Could you add port for connected? When more than one peer on an ip, the return value is confusing. image And when I ping the specified ip, it will only return one. image

nicolegys avatar Mar 13 '20 10:03 nicolegys

I'm still working on the problem with Performance Counter, but since the only command that's having this issue is check disk, I removed it from this pull request. I will include the command again in a future pull request when I can fix the Performance Counter

meevee98 avatar Mar 16 '20 16:03 meevee98

Hi @meevee98 , since we have a refactor on neo-node https://github.com/neo-project/neo-node/pull/536, now we have to make some corresponding adjustments on modules , to make the module commands could be called on neo-cli. Just like https://github.com/neo-project/neo-modules/pull/187

nicolegys avatar Mar 31 '20 03:03 nicolegys

I'm a bit concerned about that, when I use block sync, if it keeps waiting for the next block, the CPU usage will keep high until time out. image

image

nicolegys avatar Apr 01 '20 10:04 nicolegys

@meevee98 it's this solved? https://github.com/neo-project/neo-modules/pull/188#issuecomment-607162568

shargon avatar Jun 16 '20 07:06 shargon

@neo-project/ngd-shanghai could someone test it?

shargon avatar Jul 10 '20 07:07 shargon

@neo-project/ngd-shanghai could someone test it?

@cloud8little will help test this.

superboyiii avatar Jul 10 '20 08:07 superboyiii

  1. help message: PASS

c7f317a4ac8564ed66fec0c8222cfed

  1. block avgtime PASS 11853654607fd473973d7ac141a4420

  2. block sync PASS 2accd891d177fad985a9d6d9902127d

f78a55606a34f5ec9b8878a4bf9f6c8

  1. block time PASS 38ad22cbe29de83871f21ee0cd7fcf5

  2. block timesincelast PASS 7ebd72f40b25b1f80bf663edb0a535a

  3. block timestamp PASS 1b5af0092fddf24afa92253c3f89f89

  4. connected PASS 475adbf7fb0ea9bf808c6b174e83c6e

  5. ping PASS def0f32e4efb0ccb7de6086a56327f9

  6. rpc time PASS 796bf5e4ee3964a127269cf1bf3b944

  7. check state PASS a4295bd6137881322a81a0f0ec94c82

  8. tx avgsize xx PASS 8ae389c7cc6c18331df224f1655448f

  9. tx size PASS d2e246e4997c404b0d9df9da57810e0

  10. without RpcServer PASS 4ad74659eac8a680d430a89c68f1b56

  11. commit time/confirmation time/payload time @meevee98 seems when starting a consensus node, payload/confirmation always timeout. when starting consensus as watch only, it returns value. 2cabb3caa8322c7d5df5c3c946bcbd8 66fedc63bb903cb3ceb843bec6b0c26

cloud8little avatar Jul 14 '20 03:07 cloud8little

@meevee98 could you help answer the #14 please? https://github.com/neo-project/neo-modules/pull/188#issuecomment-657949676

cloud8little avatar Jul 22 '20 09:07 cloud8little

Hi @Liaojinghui, @meevee98 is my colleague. Do you guys still have interest in this PR? I don't know why it was forgotten 😅

@meevee98 could you help answer the https://github.com/neo-project/neo-modules/pull/14 please? https://github.com/neo-project/neo-modules/pull/188#issuecomment-657949676

Is this still relevant?

lock9 avatar Dec 15 '23 15:12 lock9

it doesnt support other OS, like linux. And never fixed anything, from what i can see.

cschuchardt88 avatar Dec 15 '23 20:12 cschuchardt88

close as inactive

Jim8y avatar Feb 17 '24 10:02 Jim8y