Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export block makes extremely high cost of memory which usually cause system killed on Linux. #129

Closed
superboyiii opened this issue Aug 22, 2019 · 8 comments · Fixed by #135
Labels
bug Something isn't working under investigation

Comments

@superboyiii
Copy link
Member

Export block makes extremely high cost of memory which usually cause system killed on Linux.
On mainnet export, our server which has 16G memory, is only able to hold on about 2 million blocks' export. After that, it's been killed by ubuntu. Here's the line graph. I think ImportBlocks plugin is necessary to improve algorithm for export.
image

@shargon
Copy link
Member

shargon commented Aug 22, 2019

Thanks for this tests @superboyiii , this will helps to find performance issues

@lock9
Copy link
Contributor

lock9 commented Sep 10, 2019

@superboyiii Hi! Is this solved?

@shargon
Copy link
Member

shargon commented Sep 11, 2019

@superboyiii we have the same issue with import?

@superboyiii
Copy link
Member Author

superboyiii commented Sep 11, 2019

@shargon No, it's because of that exporting block will write data straightly into memory which will cause overflow if your memory isn't large enough. But Import doesn't have this mechanism. Tom has made some effective fixes on this issue.

@shargon
Copy link
Member

shargon commented Sep 11, 2019

I think that the problem is here

https://github.com/neo-project/neo-plugins/blob/1c91346338c78537bec2760adfb363f3eb1619f5/ImportBlocks/ImportBlocks.cs#L84

Snapshot is a cache, and these blocks still on memory until the snapshot is disposed.
The best solution is create a snapshot for every block. Or add a new method, GetWithoutCache

@shargon shargon added the bug Something isn't working label Sep 11, 2019
@shargon
Copy link
Member

shargon commented Sep 11, 2019

@superboyiii could you told Tom to make a Pull request? also if he can join the two logics will be great!

https://github.com/neo-project/neo-plugins/blob/1c91346338c78537bec2760adfb363f3eb1619f5/ImportBlocks/ImportBlocks.cs#L63

@shargon
Copy link
Member

shargon commented Sep 11, 2019

I see that is already done! :)
#135

@ZhangTao1596
Copy link
Collaborator

Will do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working under investigation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants