QiOi: Performance Isolation for Hyperledger Fabric
Abstract
:1. Introduction
- We analyze the Fabric components using system-level metrics and show the different impacts of the components on performance interference.
- We design QiOi that offers component-level performance isolation for Fabric by periodically monitoring Fabric performance and adjusting CPU scheduling policy for Fabric components.
- We implement QiOi as a user-level daemon and present the evaluation results showing that QiOi mitigates performance degradation of Fabric by 22% and improves latency of Fabric by 2.5 times.
2. Background
2.1. Hyperledger Fabric
- Clients are the end-users of blockchain networks that submit transaction proposals to peers (① in Figure 1). The transaction proposals are executed and endorsed by the peers. When clients collect enough endorsements on a transaction proposal from peers (②), they assemble a transaction and broadcast this to ordering service nodes (③).
- Peers execute transaction proposals and validate transactions. There are two types of peers—endorsing peers and committing peers. The endorsing peers receive the transaction proposal from clients, execute the operation on the specified chaincode, and run the endorsement system chaincode (ESCC) to verify the transaction proposal. A chaincode is a program code that implements and executes the Fabric service logic. The chaincode is the key to Fabric service and runs as a Docker container, isolated from the peers. ESCC is one of the special chaincodes for managing the Fabric system and maintaining parameters. Then, if the verification results satisfy the endorsement policy, the endorsing peers return the transaction proposal to the client with a digital signature using the private key of the endorsing peers (②). The committing peers validate new blocks with the endorsing peers by executing the validation system chaincode (VSCC) before the actual commit of the new blocks to the distributed database, called a ledger. When validation is completed, a new block that contains the proposed transaction is stored in the ledger. Every peer maintains the ledger locally. Then, one of the peers informs the clients that the transaction has been registered successfully (⑤).
- Ordering service nodes (i.e., orderers) are the nodes that compose the ordering service. The ordering service determines the sequence of transactions into blocks using a consensus protocol. Fabric offers three consensus protocols—Solo, Raft, and Kafka. Solo is intended for testing only and consists of a single orderer. Raft and Kafka utilize a “leader and follower” model. In Raft, a leader of the orderers is elected and determines the sequence of transactions. Then, it distributes the replications of ordered transactions to the followers. The distribution of the replicated transactions enables the Raft-based ordering service to provide crash fault tolerance. Raft selects one of the followers as a leader and runs it in cases where the previous leader crashes. The Kafka-based ordering service consists of orderers, Kafka brokers, and ZooKeeper. The Kafka brokers are categorized into a leader and followers. ZooKeeper manages the Kafka brokers by selecting a leader out of the brokers and monitoring that the Kafka brokers are working properly. The Kafka leader determines the sequence of transactions. Kafka brokers that are not selected as a leader become followers. The leader of the Kafka brokers transfers ordered transactions to orderers.The orderers (i.e., both Raft and Kafka) generate new blocks using the received transactions when one of the three conditions is satisfied: (1) the number of transactions in the block reaches the threshold, (2) the block size attains the maximum value in bytes, or (3) certain time has passed since the first transaction of the new block was received. When the block generation is finished, the orderers deliver the blocks to all peers (both endorsing and committing) for validation (④).
2.2. Linux CPU Scheduler
3. Motivation
3.1. Characteristics of Fabric Components
3.2. Motivating Example
3.3. Performance Interference Analysis
4. Design and Implementation
4.1. Our Approach
4.2. QiOi Architecture
- Performance monitor periodically collects the Fabric throughput by analyzing Fabric network information in the container log of the peers. The container log is stored in the file [container id]-json.log under the directory /var/lib/docker/containers/[container id]. The Fabric network information contains transaction proposal, chaincode verification, and block commit with the timestamp. The performance monitor parses the Fabric network information every second and calculates throughput using the block commit information. Note that the monitoring period in QiOi is also adjustable.
- QiOi controller adjusts CPU share of orderers and peers when performance interference occurs. The QiOi controller regards a situation when the actual throughput is less than the isolation threshold received from the Fabric service manager as performance interference. Then the QiOi controller adjusts the CPU share of orderers and peers with the algorithm explained in Section 4.3. The adjusted CPU share is applied to CFS.
4.3. QiOi Algorithm
Algorithm 1: QiOi algorithm. |
5. Evaluation
5.1. Support for Different Ordering Services
5.2. Support for Different Chaincodes
5.3. Support for Practical Co-Located Tasks
5.4. Overhead Measurement
6. Discussion
7. Related Work
7.1. Performance Evaluation and Characterization
7.2. Performance Improvement
7.3. Performance Isolation and Resource Management
8. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Thakkar, P.; Nathan, S.; Viswanathan, B. Performance benchmarking and optimizing Hyperledger Fabric blockchain platform. In Proceedings of the 2018 IEEE 26th International SymposiumonModeling, Analysis, and Simulation of Computer and Telecommunication Systems (MASCOTS), Milwaukee, WI, USA, 25–28 September 2018; IEEE: New York, NY, USA, 2018; pp. 264–276. [Google Scholar]
- Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. 2008. Available online: https://bitcoin.org/bitcoin.pdf (accessed on 16 March 2021).
- Ripple. Available online: https://ripple.com/ (accessed on 16 March 2021).
- Enzyme Finance—On-Chain Asset Management. Available online: https://enzyme.finance/ (accessed on 16 March 2021).
- Morgan, J.; Wyman, O. Unlocking Economic Advantage with Blockchain. A Guide for Asset Managers; JP Morgan Reports: New York, NY, USA, 2016. [Google Scholar]
- Lim, J.M.; Kim, Y.; Yoo, C. Chain Veri: Blockchain-Based Firmware Verification System for IoT Environment. In Proceedings of the 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData), Halifax, NS, Canada, 30 July–3 August 2018; IEEE: New York, NY, USA, 2018; pp. 1050–1056. [Google Scholar]
- Hyperledger Fabric. Available online: https://github.com/hyperledger/fabric (accessed on 16 March 2021).
- Androulaki, E.; Barger, A.; Bortnikov, V.; Cachin, C.; Christidis, K.; De Caro, A.; Enyeart, D.; Ferris, C.; Laventman, G.; Manevich, Y.; et al. Hyperledger Fabric: A distributed operating system for permissioned blockchains. In Proceedings of the Thirteenth EuroSys Conference, Porto, Portugal, 23–26 April 2018; pp. 1–15. [Google Scholar]
- Digitizing Global Trade with Maersk and IBM. 2018. Available online: https://www.ibm.com/blogs/blockchain/2018/01/digitizing-global-trade-maersk-ibm/ (accessed on 16 March 2021).
- SecureKey: Building Trusted Identity Networks. Available online: https://securekey.com/ (accessed on 16 March 2021).
- Everledger—Tech for Good Blockchain Solutions. Available online: https://www.everledger.io/ (accessed on 16 March 2021).
- Hyperledger Blockchain Performance Metrics. Whitepaper. Available online: https://www.hyperledger.org/wpcontent/uploads/2018/10/HL_Whitepaper_Metrics_PDF_V1 (accessed on 16 March 2021).
- Soltesz, S.; Pötzl, H.; Fiuczynski, M.E.; Bavier, A.; Peterson, L. Container-based operating system virtualization: A scalable, high-performance alternative to hypervisors. In Proceedings of the 2nd ACM SIGOPS/EuroSys European Conference on Computer Systems, Lisbon, Portugal, 20–23 March 2007; Association for Computing Machinery: New York, NY, USA, 2007; pp. 275–287. [Google Scholar]
- Wang, P.; Meng, J.; Chen, J.; Liu, T.; Zhan, Y.; Tsai, W.T.; Jin, Z. Smart contract-based negotiation for adaptive QoS-aware service composition. IEEE Trans. Parallel Distrib. Syst. 2018, 30, 1403–1420. [Google Scholar] [CrossRef]
- Silva, M.; Ryu, K.D.; Da Silva, D. VM performance isolation to support QoS in cloud. In Proceedings of the 2012 IEEE 26th International Parallel and Distributed Processing Symposium Workshops & PhD Forum, Shanghai China, 21–25 May 2012; IEEE: New York, NY, USA, 2012; pp. 1144–1151. [Google Scholar]
- Javaid, H.; Hu, C.; Brebner, G. Optimizing Validation Phase of Hyperledger Fabric. In Proceedings of the 2019 IEEE 27th International Symposium onModeling, Analysis, and Simulation of Computer and Telecommunication Systems (MASCOTS), Rennes, France, 22–25 October 2019; IEEE: New York, NY, USA, 2019; pp. 269–275. [Google Scholar]
- LevelDB Key-Value Database in Go. Available online: https://github.com/syndtr/goleveldb (accessed on 16 March 2021).
- Apache CouchDB. Available online: https://couchdb.apache.org/ (accessed on 16 March 2021).
- Yusuf, H.; Surjandari, I. Comparison of Performance Between Kafka and Raft as Ordering Service Nodes Implementation in Hyperledger Fabric. Int. J. Adv. Sci. Technol. 2020, 29, 3549–3554. [Google Scholar]
- Ongaro, D.; Ousterhout, J. In search of an understandable consensus algorithm. In Proceedings of the 2014 USENIX Annual Technical Conference (USENIX ATC), Philadelphia, PA, USA, 19–20 June 2014; pp. 305–319. [Google Scholar]
- Apache Kafka. Available online: http://kafka.apache.org/ (accessed on 16 March 2021).
- Khalid, J.; Rozner, E.; Felter, W.; Xu, C.; Rajamani, K.; Ferreira, A.; Akella, A. Iron: Isolating Network-based CPU in Container Environments. In Proceedings of the 15th USENIX Symposium on Networked Systems Design and Implementation (NSDI), Renton, WA, USA, 9–11 April 2018; pp. 313–328. [Google Scholar]
- Kim, Y.K.; HoseinyFarahabady, M.R.; Lee, Y.C.; Zomaya, A.Y.; Jurdak, R. Dynamic control of cpu usage in a lambda platform. In Proceedings of the 2018 IEEE International Conference on Cluster Computing (CLUSTER), Belfast, UK, 10–13 September 2018; IEEE: New York, NY, USA, 2018; pp. 234–244. [Google Scholar]
- Xu, C.; Rajamani, K.; Felter, W. NBWGuard: Realizing Network QoS for Kubernetes. In Proceedings of the 19th International Middleware Conference Industry, Rennes, France, 10–14 December 2018; pp. 32–38. [Google Scholar]
- Li, Y.; Zhang, J.; Jiang, C.; Wan, J.; Ren, Z. PINE: Optimizing performance isolation in container environments. IEEE Access 2019, 7, 30410–30422. [Google Scholar] [CrossRef]
- Zaharia, M.; Chowdhury, M.; Das, T.; Dave, A.; Ma, J.; McCauly, M.; Franklin, M.J.; Shenker, S.; Stoica, I. Resilient distributed datasets: A fault-tolerant abstraction for in-memory cluster computing. In Proceedings of the 9th USENIX Symposium on Networked Systems Design and Implementation (NSDI 12), San Jose, CA, USA, 25–27 April 2012; pp. 15–28. [Google Scholar]
- Bouron, J.; Chevalley, S.; Lepers, B.; Zwaenepoel, W.; Gouicem, R.; Lawall, J.; Muller, G.; Sopena, J. The Battle of the Schedulers: FreeBSD ULE vs. Linux CFS. In Proceedings of the 2018 USENIX Annual Technical Conference (USENIX ATC), Boston, MA, USA, 11–13 July 2018; pp. 85–96. [Google Scholar]
- Wong, C.; Tan, I.; Kumari, R.; Lam, J.; Fun, W. Fairness and interactive performance of O (1) and CFS Linux kernel schedulers. In Proceedings of the 2008 International Symposium on Information Technology, Kuala Lumpur, Malaysia, 26–29 August 2008; IEEE: New York, NY, USA, 2008; Volume 4, pp. 1–8. [Google Scholar]
- Kulkarni, S.G.; Zhang, W.; Hwang, J.; Rajagopalan, S.; Ramakrishnan, K.; Wood, T.; Arumaithurai, M.; Fu, X. Nfvnice: Dynamic backpressure and scheduling for nfv service chains. In Proceedings of the Conference of the ACM Special Interest Group on Data Communication, Los Angeles, CA, USA, 21–25 August 2017; pp. 71–84. [Google Scholar]
- Turner, P.; Rao, B.B.; Rao, N. CPU bandwidth control for CFS. In Proceedings of the Linux Symposium, Ottawa, ON, Canada, 13–16 July 2010; pp. 245–254. [Google Scholar]
- Hyperledger Caliper—Hyperledger. Available online: https://www.hyperledger.org/use/caliper (accessed on 16 March 2021).
- Hyperledger Caliper Benchmarks. Available online: https://github.com/hyperledger/caliper-benchmarks (accessed on 16 March 2021).
- What’s New in Hyperledger Fabric v2.x. Available online: https://hyperledger-fabric.readthedocs.io/en/release-2.3/whatsnew.html (accessed on 16 March 2021).
- Sysbench—A Modular, Cross-Platform and Multi-Threaded Benchmark Tool. Available online: http://manpages.ubuntu.com/manpages/trusty/man1/sysbench.1.html (accessed on 16 March 2021).
- Shi, J.; Qiu, Y.; Minhas, U.F.; Jiao, L.; Wang, C.; Reinwald, B.; Özcan, F. Clash of the titans: Mapreduce vs. spark for large scale data analytics. Proc. Vldb Endow. 2015, 8, 2110–2121. [Google Scholar] [CrossRef] [Green Version]
- Kwon, M.; Yu, H. Performance Improvement of Ordering and Endorsement Phase in Hyperledger Fabric. In Proceedings of the 2019 Sixth International Conference on Internet of Things: Systems, Management and Security (IOTSMS), Granada, Spain, 22–25 October 2019; IEEE: New York, NY, USA, 2019; pp. 428–432. [Google Scholar]
- Gorenflo, C.; Lee, S.; Golab, L.; Keshav, S. FastFabric: Scaling Hyperledger Fabric to 20000 transactions per second. Int. J. Netw. Manag. 2020, 30, e2099. [Google Scholar] [CrossRef] [Green Version]
- Kim, J.; Lee, K.; Yang, G.; Lee, K.; Im, J.; Yoo, C. Exploring the Characteristics of Hyperledger Fabric in Resource Consumption. In Proceedings of the 2020 2nd Conference on Blockchain Research & Applications for Innovative Networks and Services (BRAINS), Paris, France, 28–30 February 2020; IEEE: New York, NY, USA, 2020; pp. 208–209. [Google Scholar]
- The Ordering Service. Available online: https://hyperledger-fabric.readthedocs.io/en/latest/orderer/ordering_service.html (accessed on 16 March 2021).
- Zhu, L.; Chen, C.; Su, Z.; Chen, W.; Li, T.; Yu, Z. BBS: Micro-Architecture Benchmarking Blockchain Systems through Machine Learning and Fuzzy Set. In Proceedings of the 2020 IEEE International Symposium on High Performance Computer Architecture (HPCA), San Diego, CA, USA, 22–26 February 2020; IEEE: New York, NY, USA, 2020; pp. 411–423. [Google Scholar]
- Ousterhout, K.; Rasti, R.; Ratnasamy, S.; Shenker, S.; Chun, B.G. Making sense of performance in data analytics frameworks. In Proceedings of the 12th USENIX Symposium on Networked Systems Design and Implementation (NSDI 15), Oakland, CA, USA, 4–6 May 2015; pp. 293–307. [Google Scholar]
- Samadi, Y.; Zbakh, M.; Tadonki, C. Performance comparison between Hadoop and Spark frameworks using HiBench benchmarks. Concurr. Comput. Pract. Exp. 2018, 30, e4367. [Google Scholar] [CrossRef]
- Kubernetes. Available online: https://kubernetes.io/ (accessed on 16 March 2021).
- Nasir, Q.; Qasse, I.A.; Abu Talib, M.; Nassif, A.B. Performance analysis of Hyperledger Fabric platforms. Secur. Commun. Networks 2018, 2018, 3976093. [Google Scholar] [CrossRef] [Green Version]
- Baliga, A.; Solanki, N.; Verekar, S.; Pednekar, A.; Kamat, P.; Chatterjee, S. Performance characterization of Hyperledger Fabric. In Proceedings of the 2018 Crypto Valley Conference on Blockchain Technology (CVCBT), Zug, Switzerland, 20–22 June 2018; IEEE: New York, NY, USA, 2018; pp. 65–74. [Google Scholar]
- Shalaby, S.; Abdellatif, A.A.; Al-Ali, A.; Mohamed, A.; Erbad, A.; Guizani, M. Performance Evaluation of Hyperledger Fabric. In Proceedings of the 2020 IEEE International Conference on Informatics, IoT, and Enabling Technologies (ICIoT), Doha, Qatar, 2–5 February 2020; IEEE: New York, NY, USA, 2020; pp. 608–613. [Google Scholar]
- Kuzlu, M.; Pipattanasomporn, M.; Gurses, L.; Rahman, S. Performance analysis of a Hyperledger Fabric blockchain framework: Throughput, latency and scalability. In Proceedings of the 2019 IEEE International Conference on Blockchain (Blockchain), Atlanta, GA, USA, 14–17 July 2019; IEEE: New York, NY, USA, 2019; pp. 536–540. [Google Scholar]
- Wang, C.; Chu, X. Performance Characterization and Bottleneck Analysis of Hyperledger Fabric. arXiv 2020, arXiv:2008.05946. [Google Scholar]
- Nakaike, T.; Zhang, Q.; Ueda, Y.; Inagaki, T.; Ohara, M. Hyperledger Fabric Performance Characterization and Optimization Using GoLevelDB Benchmark. In Proceedings of the 2020 IEEE International Conference on Blockchain and Cryptocurrency (ICBC), Rhodes Island, Greece, 2–6 November 2020; IEEE: New York, NY, USA, 2020; pp. 1–9. [Google Scholar]
Parameters | Values |
---|---|
Ordering service | Raft |
StateDB | GoLevelDB |
Endorsement policy | OR(Org1, Org2) |
Block size/timeout | 100 MB/2 s |
Total transactions | 10,000 |
Transaction send rate | 1000 |
Component | Avg. Time Slice (ms) | Scheduling Delay (ms) | The Number of Context Switch/s |
---|---|---|---|
Peer | 0.22 | 0.53 | 13051 |
Orderer | 0.10 | 0.41 | 7947 |
Chaincode | 0.05 | 0.10 | 6241 |
Avg. Time Slice (ms) | Scheduling Delay (ms) | The Number of Context Switch/s | |
---|---|---|---|
Alone | 328 | 0.30 | 24 |
Together | 58 | 0.53 | 138 |
The Value of k | Baseline | 2 | 4 | 6 | 8 | 10 |
---|---|---|---|---|---|---|
Sysbench throughput (events/s) | 34.2 | 33.9 | 33.7 | 33.9 | 33.6 | 33.9 |
Throughput (tps) | Latency (s) | Peer CPU Utilization (%) | Orderer CPU Utilization (%) | |
---|---|---|---|---|
Alone | 787 | 1.27 | 22.3 | 5.4 |
w/ QiOi | 785 | 0.93 | 22.0 | 5.3 |
Typical Characterization of Fabric | Optimization for Performance Improvement | Performance Interference in Fabric | |
---|---|---|---|
Nasir et al. [44] | ✓ | ✗ | ✗ |
Balig et al. [45] | ✓ | ✗ | ✗ |
Thakkar et al. [1] | ✓ | ✓ | ✗ |
Kuzlu et al. [47] | ✓ | ✗ | ✗ |
Javaid et al. [16] | ✓ | ✓ | ✗ |
Kwon and Yu [36] | ✓ | ✓ | ✗ |
Gorenflo et al. [37] | ✓ | ✓ | ✗ |
Shalaby et al. [46] | ✓ | ✗ | ✗ |
Yusuf and Surjandari [19] | ✓ | ✗ | ✗ |
Nakaike et al. [49] | ✓ | ✓ | ✗ |
Wang and Chu [48] | ✓ | ✗ | ✗ |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Kim, J.; Lee, K.; Yang, G.; Lee, K.; Im, J.; Yoo, C. QiOi: Performance Isolation for Hyperledger Fabric. Appl. Sci. 2021, 11, 3870. https://doi.org/10.3390/app11093870
Kim J, Lee K, Yang G, Lee K, Im J, Yoo C. QiOi: Performance Isolation for Hyperledger Fabric. Applied Sciences. 2021; 11(9):3870. https://doi.org/10.3390/app11093870
Chicago/Turabian StyleKim, Jeongsu, Kyungwoon Lee, Gyeongsik Yang, Kwanhoon Lee, Jaemin Im, and Chuck Yoo. 2021. "QiOi: Performance Isolation for Hyperledger Fabric" Applied Sciences 11, no. 9: 3870. https://doi.org/10.3390/app11093870
APA StyleKim, J., Lee, K., Yang, G., Lee, K., Im, J., & Yoo, C. (2021). QiOi: Performance Isolation for Hyperledger Fabric. Applied Sciences, 11(9), 3870. https://doi.org/10.3390/app11093870