# QiOi: Performance Isolation for Hyperledger Fabric
## 3 Motivation
### Characteristics of Fabric Components  
First, we measure system-level metrics such as scheduling delay to understand the different characteristics of Fabric components. Since Fabric consists of multiple components that perform different operations, it is essential to characterize them component by component. Furthermore, such characterization is necessary to develop a performance isolation techniques for Fabric. For experiments, we utilized a server equipped with two Intel Xeon processors (E5-2650 [EMAIL_ADDRESS] GHz, 12 cores) running Ubuntu 16.04 LTS (Linux v4.15.0) with 128 GB of RAM and 447 GB HDD as a local disk. In addition, we used Fabric v1.4.1 with the Raft-based ordering service and Hyperledger Caliper v0.2.0. Hyperledger Caliper (Caliper) [31] is a widely-used performance benchmark framework for blockchain networks. We utilized Caliper to construct the blockchain network based on Fabric and to measure Fabric performance in terms of throughput and latency by executing various chaincodes provided by Caliper. In our experiments, Fabric components ran as containers on Docker v19.03.13. Figure 2 shows the setup of Fabric components used in our experiments, which consisted of four peers, three orderers using GoLevelDB. We configured Caliper to run 10 clients that generated and transmit 10,000 transaction proposals in total. As chaincode, we ran the smallbank [32] which is one of the most widely used benchmarks and performs account opening, deposit, and money transfer [16]. Note that Table 1 shows the detailed configuration of Fabric. We utilized a system-level profiling tool, _perfsched_, and measure scheduling metrics, such as average time slices, scheduling delay, and the number of context switches. The average time slice is the average CPU time occupied by a process while Fabric is running, and the scheduling delay refers to the length of time the process waits for it to be scheduled. The number of context switches indicates the number of stopping a process to starting another one. Table 2 presents the results of the average time slices, scheduling delay, and the number of context switches per second for Fabric components. We find that all scheduling metrics are in the order of peers, orderers, and chaincodes. This means that peers consume the largest CPU time among the components and are more scheduled than orderers and chaincodes. We find that this is because peers perform verification of the client's transaction proposals and validate new blocks. On the other hand, orderers and chaincodes consume relatively less CPU time. In addition, the average time slice and scheduling delay of all components do not exceed 0.53 ms, making them quite short periods of time. This indicates that Fabric components finish their operations in a short period of time while being scheduled rather frequently. Note that Fabric performance may vary depending on the Fabric version. However, this paper focuses on demonstrating that Fabric experiences performance interference because of the co-located tasks. Because peers and orderers perform similar operations regardless of the version after v1.4.1, we believe that we will have similar results with the latest Fabric version. Note that the latest versions after v2.0 mostly focus on supporting functionalities for chaincode and channel [33]. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Values** \\ \hline Ordering service & Raft \\ StateDB & GoLevelDB \\ Endorsement policy & OR(Org1, Org2) \\ Block size/timeout & 100 MB/2 s \\ Total transactions & 10000 \\ Transaction send rate & 1000 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Fabric configuration. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Component** & **Avg. Time Slice (ms)** & **Scheduling Delay (ms)** &
\begin{tabular}{c} **The Number of** \\ **Context Switch/s** \\ \end{tabular} \\ \hline Peer & 0.22 & 0.53 & 13051 \\ Orderer & 0.10 & 0.41 & 7947 \\ Chaincode & 0.05 & 0.10 & 6241 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: System-level profiling of Fabric components.