Author Topic: Understanding Bitshares TPS bottlenecks?  (Read 3614 times)

0 Members and 1 Guest are viewing this topic.

Offline jsidhu

  • Hero Member
  • *****
  • Posts: 1335
    • View Profile
It wouldn't surprise me if bitshares2.0 could achieve a higher TPS with a larger block interval.

TPS is like bandwidth.

http://www.azquotes.com/picture-quotes/quote-never-underestimate-the-bandwidth-of-a-station-wagon-full-of-tapes-hurtling-down-the-andrew-s-tanenbaum-80-15-90.jpg

Block interval is bounded by latency.

Bandwidth can increase latency by  BLOCK_SIZE / BANDWIDTH. 

With some simple math we can compute theoretical limits and then discount for CPU overhead, margin of error, clock synchronization issues, etc.

Attempting to accelerate blockchains is like attempting to accelerate electrical signals and frequency.

So in other words since we can do say 30 TPS @ 3 seconds stable on todays low end vps based testnet (all variables factored in) if we increase to 10 min blocktimes to do an apples to apples comparison with bitcoin we can do 6000 TPS with the current p2p implementation. More once we have better VPS's to demo a more stable testnet with tweaks to the p2p code.
« Last Edit: October 07, 2015, 07:12:34 pm by jsidhu »
Hired by blockchain | Developer
delegate: dev.sidhujag

Offline bytemaster

The analogy I use to understand 100 TPS / sec is this.

An Intel Core i7 CPU can perform 70 GFLOPS per second  ** UNDER THE RIGHT CONDITIONS **.   If all of your floating point data is stored in a giant database that is randomly accessed then you will never see 70 GFLOPS.    Intel still gets to advertize 70 GFLOPS because that is what the CPU is capable of.

Likewise, Graphene is the CPU of a blockchain and can process over 100K TPS  ** UNDER THE RIGHT CONDITIONS **.   The benchmark for those conditions is streaming a blockchain from disk.

The next step in the hunt for speed is to build a network protocol that is able to stream data to the CPU quickly enough.

At this point in time, even if we doubled Graphene's efficiency to 200K TPS it wouldn't give us any meaningful increase in real-world performance.   The SYSTEM as a whole can currently sustain 100 TPS.  Upgrading servers/bandwidth may be able to improve that to 200 TPS with bursts to 1000 TPS.   


« Last Edit: October 07, 2015, 07:11:17 pm by bytemaster »
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline bytemaster

It wouldn't surprise me if bitshares2.0 could achieve a higher TPS with a larger block interval.

TPS is like bandwidth.

http://www.azquotes.com/picture-quotes/quote-never-underestimate-the-bandwidth-of-a-station-wagon-full-of-tapes-hurtling-down-the-andrew-s-tanenbaum-80-15-90.jpg

Block interval is bounded by latency.

Bandwidth can increase latency by  BLOCK_SIZE / BANDWIDTH. 

With some simple math we can compute theoretical limits and then discount for CPU overhead, margin of error, clock synchronization issues, etc.

Attempting to accelerate blockchains is like attempting to accelerate electrical signals and frequency. 
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline jsidhu

  • Hero Member
  • *****
  • Posts: 1335
    • View Profile
https://bitsharestalk.org/index.php/topic,18751.msg242103.html#msg242103

can we run 36 core witnesses and see if we can hit 100k tps?

At that point, id like to try to set the block time to 10min and see what the new TPS is. Just for fun while we are there.
Hired by blockchain | Developer
delegate: dev.sidhujag

Offline Helikopterben

  • Sr. Member
  • ****
  • Posts: 202
    • View Profile
Smooth tried to argue that a DEX is useless because it would be front run by HFT.  I think of it differently though.  HFT is the same thing as PoW.  You're expending resources to capture a finite revenue stream vs competitors (skimming).  The process eventually leads to either complete centralization (monopoly), or something very close to it.  Since HFT is a consensus of only one or a few parties, the DEX might be the market maker instead.

I'm not saying that. I'm saying that the big financial players in the real world (the HFT firms) have a disincentive to use a DEX because they lose their competitive advantage by doing so. They will always prefer the centralised alternative, so decreasing block times to suit them is pointless, especially at the detriment of other features.

HFTs derive their revenue from transactions made by all other traders and investors.  All other traders and investors have an incentive to move to the DEX because they will get to keep the small amount of money that was being skimmed by the HFTs.  As traditional traders and investors leave centralized exchanges, HFTs will have fewer and fewer users to feed off of, ending their business model.

Offline Pheonike

Smooth tried to argue that a DEX is useless because it would be front run by HFT.  I think of it differently though.  HFT is the same thing as PoW.  You're expending resources to capture a finite revenue stream vs competitors (skimming).  The process eventually leads to either complete centralization (monopoly), or something very close to it.  Since HFT is a consensus of only one or a few parties, the DEX might be the market maker instead.

I'm not saying that. I'm saying that the big financial players in the real world (the HFT firms) have a disincentive to use a DEX because they lose their competitive advantage by doing so. They will always prefer the centralised alternative, so decreasing block times to suit them is pointless, especially at the detriment of other features.
That's good. Let them try to out cheat each other on their own networks. We will be the exchange for the regular ppl.

Offline jsidhu

  • Hero Member
  • *****
  • Posts: 1335
    • View Profile
I said to assume its used for settlement reasons only (satoshis tradeoff of security over performance). Assume no dex here.

Its simple, using higher blocktime would increase tps, but by how much?
Hired by blockchain | Developer
delegate: dev.sidhujag

Offline monsterer

Smooth tried to argue that a DEX is useless because it would be front run by HFT.  I think of it differently though.  HFT is the same thing as PoW.  You're expending resources to capture a finite revenue stream vs competitors (skimming).  The process eventually leads to either complete centralization (monopoly), or something very close to it.  Since HFT is a consensus of only one or a few parties, the DEX might be the market maker instead.

I'm not saying that. I'm saying that the big financial players in the real world (the HFT firms) have a disincentive to use a DEX because they lose their competitive advantage by doing so. They will always prefer the centralised alternative, so decreasing block times to suit them is pointless, especially at the detriment of other features.
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline r0ach

  • Full Member
  • ***
  • Posts: 93
    • View Profile
A DEX will never take away all the business from centralised exchanges - all the HFT shops rely on their superior speed to make profits and a DEX robs them of that speed, so they won't consider them a viable option.

Smooth tried to argue that a DEX is useless because it would be front run by HFT.  I think of it differently though.  HFT is the same thing as PoW.  You're expending resources to capture a finite revenue stream vs competitors (skimming).  The process eventually leads to either complete centralization (monopoly), or something very close to it.  Since HFT is a consensus of only one or a few parties, the DEX might be the market maker instead.

Offline monsterer

I'm not sure how fast of blocks you need on a DEX for centralized exchanges to not take all their business away, but I'm feeling like the upper limit might be something like 5 seconds.

A DEX will never take away all the business from centralised exchanges - all the HFT shops rely on their superior speed to make profits and a DEX robs them of that advantage, so they won't consider them a viable option.
« Last Edit: October 07, 2015, 08:39:24 am by monsterer »
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline r0ach

  • Full Member
  • ***
  • Posts: 93
    • View Profile
I guess it all comes down to two things, how fast of blocks you need for a DEX, and how many confirms retailers will require for transactions.   Bologniex requires 10 for a deposit right now, I think.  If all retailers required 10 confirms, anything over 3 second blocks would not be very feasible for physical, in-store use at something like a grocery store.  If they only require 1 or 2, that part doesn't matter too much and you're back to the DEX issue.

I'm not sure how fast of blocks you need on a DEX for centralized exchanges to not take all their business away, but I'm feeling like the upper limit might be something like 5 seconds.

Offline monsterer

It wouldn't surprise me if bitshares2.0 could achieve a higher TPS with a larger block interval.
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Actually, it wouldn't. There is much more going on that that simple math; a lower block time increases the frequency of block broadcasts which has its own set of latency problems. Increasing the number of transactions per block is probably more efficient than decreasing the block time up to a certain point.
Sure .. there are several veriables if you want to be technical ..
It kind of breaks down to the relation of power and energy as Stan recently posted in another thread .. and the blockchain kind of is the wire you want to use to transfer your energy/power .. if it is not stong enough if will burn :)

Offline monsterer

TPS stands for transactions per *SECOND* .. now if you assume a block can carry at most 300 transactions (as in bitcoin) a decrease of block time from 10 minutes to 1 second would result in an increase of the "tps" of factor 600

Actually, it wouldn't. There is much more going on that that simple math; a lower block time increases the frequency of block broadcasts which has its own set of latency problems. Increasing the number of transactions per block is probably more efficient than decreasing the block time up to a certain point.
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
TPS stands for transactions per *SECOND* .. now if you assume a block can carry at most 300 transactions (as in bitcoin) a decrease of block time from 10 minutes to 1 second would result in an increase of the "tps" of factor 600

The initial BTS2 blockchain will have 3 secs block time with the option to reduce (or increase) at will without hard fork by shareholders' approval