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

Witness_node Memory Management Discussion #621

Closed
abitmore opened this issue Mar 14, 2016 · 4 comments
Closed

Witness_node Memory Management Discussion #621

abitmore opened this issue Mar 14, 2016 · 4 comments

Comments

@abitmore
Copy link
Contributor

This ticket is for discussing potential optimization on memory management of witness_node.

Currently, 5 months after BTS 2.0 launch,

  • head_block_num is about 4,300,000,
  • a typical witness_node running in Windows 7 64 bit uses about 2GB of memory (physical+virtual),
  • a typical witness_node running in Ubuntu 14.04 LTS amd64 uses about 2GB of memory as well (VIRT>2,000,000 and RES=1.16g on one of my node).

Perhaps we'll have to face scalability issues rather soon.

Ideas?

@theoreticalbts
Copy link
Contributor

Originally BitShares was created with architecture of core (bare minimum needed for validation) and plugins (containing data not needed for validation, e.g. operation history). As time went on, more and more code stopped following this architecture. There's a lot of stuff in the core that needs to be moved to a plugin.

For example:

  • Block producing witnesses need not track operation history at all
  • Single-user wallets need only track operation history for user's account
  • Hosted wallets need to track all operation history

Related: #246 #422 #571

As a large portion of the objects are never modified, as a stopgap you can simply run the witness node on a system with a large swap file.

@abitmore
Copy link
Contributor Author

Using larger swap file seems to be a good idea. However, when a swapped out object need to be read (but not be modified), it still need to be swapped in, this will more or less affect performance.

We need analysis to show what objects are in memory, how big is each of them, how useful is each of them etc. As @theoreticalbts mentioned, market history is one of useless objects for block producers.

@pmconrad
Copy link

The "large swap" idea may not work if rarely used objects in memory are interleaved with often-used objects. A single often-used object in a memory page will effectively lock that page in RAM.

@vikramrajkumar
Copy link
Contributor

This issue was moved to bitshares/bitshares-core#192

pmconrad pushed a commit to pmconrad/graphene that referenced this issue Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants