[英]How Hyperledger Fabric ledger size impacts performance?
存儲在/var/hyperledger/production
中的分類帳大小每天都在增加。 例如,在 3-4 年后,大小可以以 TB 為單位。 有沒有 -
對於你的問題,我嘗試在源代碼中找到答案,以及一點點答案
1、第一個問題:
在fabric v1.4.2源碼commom/ledger/blockfile_mgr.go
中,使用getTransactionByID
方法作為tx查詢,根據這個方法,最終這個方法會調用getTxLoc
方法,我們可以知道當我們查詢一個tx時,我們需要先獲取tx所在的block,我們可以通過index快速找到這個block(我對indexing機制沒有深入了解,但我認為它對性能有幫助)
2、關於你的第二個和第三個問題:
在fabric v1.4.2 source code commom/ledger/blockfile_mgr.go
中,方法addBlock
被用作blockfile的添加塊(位於/var/hyperledger/production/...blockfile_000000),我們可以在這個方法中找到一些有用的信息:
//Determine if we need to start a new file since the size of this block
//exceeds the amount of space left in the current file
//default value of maxBlockfileSize is 64 * 1024 * 1024
if currentOffset+totalBytesToAppend > mgr.conf.maxBlockfileSize {
mgr.moveToNextFile()
currentOffset = 0
}
這意味着當塊文件大於 64 * 1024 * 1024 時,它將創建一個新的塊文件
3、關於你的最后一個問題
我沒有找到相關信息
希望這些對你有幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.