rise-node icon indicating copy to clipboard operation
rise-node copied to clipboard

Enhance TPS value

Open vekexasia opened this issue 6 years ago • 0 comments

Right now a medium-end CPU can roughly handle 7tps. While this is more than enough right now, the situation can rapidly change and a solution should be already in place.

Current Implementation: The node is so slow to process the transactions caus of different implementation pitfalls:

  1. txs and blocks are not saved atomically in one single DB transaction.
  2. pending txs are undo + block txs are unconfirmed and then confirmed (3 steps)
  3. Every action hits the Database to ensure data consistency
  4. The txs checks cannot be parallelize due to the way the core is written

Ways to improve

  • [x] Moving the data consistency checks to a faster db (Redis?)
  • [x] Avoid undoing all unconfirmed transactions before applying blocks txs.
  • [ ] Use redis as single source of through (all writes and reads are there) and sync to postgres later (asynchronously)
  • [ ] horizontal scaling through multi-core

vekexasia avatar Mar 11 '18 15:03 vekexasia