• No results found

3.4 Performance Evaluation

3.4.3 Sensitivity Study

5000 10000 15000 20000 25000 16 64 256 1024

Throughput (Unit:Records Per Second)

Leaf Block Size (Unit:KB) Random Workload Sequential Workload Clustered Workload(Cluster Length: 32)

Figure 3.4: Record insertion throughput of a BOSC-based B+ tree implementation

under the sequential insertion, clustered insertion, and random insertion workload when the leaf node size is varied from 16 KB to 1024 KB. The X axis is log-scale. The Y axis is the number of new records inserted per second. The memory allocated for all per-block request queues is 1 GB, the record size is 64 B, and the initial index size is 64GB.

The default setting for the B+ tree experiments whose results are reported in this section is as follows. The key field of each B+ tree index record is

16 bytes long, and the record size can vary. The total memory available for BOSC’s per-block request queues is up to 1536MB. The B+ tree’s internal nodes are pinned down in physical memory and require about 200 MB for a 128-GB index with a 16-KB leaf block size and 64B record size. In the sequential insert workload, the key values of the newly inserted index records increase from 0 to 260 sequentially. In the random insert workload, the key

values of the newly inserted index records are uniformly distributed between 0 and 2d, where d depends on the index size, the record size and also how the test B+ tree index is initialized.

If the index size is A , the record size is B and the incremental step in initializing the B+ tree index is C, then d = log(C∗ 0.5 ∗ A/B), where 0.5 is

0 5000 10000 15000 20000 25000 0 100 200 300 400 500 600 700 800 900 1000 1100

Throughput (Unit:Records Per Second)

Record Size (Unit:B)

Random Workload Sequential Workload Clustered Workload(Cluster Length: 32)

Figure 3.5: Record insertion throughput of a BOSC-based B+ tree implementation

under the sequential insertion, clustered insertion, and random insertion workload when the index record size is varied from 64 B to 1024 B. The Y axis shows the number of new records inserted per second. The memory allocated for all per-block request queues is 1 GB, the leaf block size is 64 KB, and the initial index size is 128 GB.

the fill factor of the initial B+ tree index. For example, if the index is 128 GB,

the record is 64 B and C = 1000, then d is 40.

In the clustered insert workload, key values of the newly inserted index records within a cluster are increasing consecutively and each cluster starts with a random key value. The cluster size is fixed at 32 in all experiments if not specified otherwise. In the random update workload, the key values of the updated index records are randomly chosen from key values previously inserted by the random insert workload.

In this section, we evaluate the impact of the leaf node size, the index record size, the index size and the buffer memory size on the performance of the BOSC-based B+ tree. Four data disks and one log disk are used.

Each experiment run starts with a fixed-sized initial B+ tree and continues with index record insertions/updates until the first sequential commit cycle is completed. At that point, we measured the total number of insertions/updates and the elapsed time.

In evaluating the impact of different parameters on the insert/update rate, there are 3 factors to consider: (1) the disk I/O efficiency, which reflects how effectively the I/O thread removes unnecessary disk access overhead, (2) the degree of batching, which determines how many requests over which each disk I/O operation’s cost is amortized, and (3) the CPU overhead associated

0 5000 10000 15000 20000 25000 64 256 512 1024

Throughput (Unit:Records Per Second)

Record Size (Unit:B)

Random Workload Sequential Workload Clustered Workload(Cluster Length: 32)

Figure 3.6: Record insertion throughput of a BOSC-based B+ tree implementation

under the sequential insertion, clustered insertion, and random insertion workload when the index record size increases from 64 B to 1 KB, and the leaf node size also varies proportionally so that the ratio between the two is fixed. The Y axis shows the number of new records inserted per second. The memory allocated for all per-block request queues is 1 GB, and the index size is 128 GB.

with traversing from the B+ tree’s root to the target leaf node of a given

insert/update request, and queuing pending requests.

The throughputs of the BOSC-based B+ tree under the random insertion,

sequential insertion and clustered insertion workload when the leaf node size varies are shown in Figure 3.4.

In general, the throughput performance of the BOSC-based B+ tree index

under the sequential insert workload is much higher than that under the ran- dom insert workload for two reasons. First, the average number of pending requests in each queue at the time of commit is higher under the sequen- tial insert workload than that under the random insert workload. Second, the CPU overhead of processing insert/update requests is lower under the se- quential insert workload than that under the random insert workload because of fewer L2 cache misses. For the random insert workload, it takes around 140 micro-seconds to complete an insertion request, whereas it takes only 67 micro-seconds for the sequential insert workload.

As the size of the test B+ tree index’s leaf block is increased, more index

records can be packed into each leaf block, the degree of batching in terms of number of pending requests per disk block fetched is increased and so is the throughput of the BOSC-based B+ tree index, as shown in Figure 3.4. This

effect is more pronounced under the clustered and sequential insert workload than under the random insert workload, because there is not much batching in the random insert workload anyway.

Figure 3.5 shows that, as the size of the test B+ tree’s index record is increased, fewer index records can fit within each leaf block, and the degree of batching in terms of number of pending requests per disk block is decreased. The throughput degradation for the clustered insert and random insert work- load is directly correlated with the decrease in the degree of batching, but that for the sequential insert workload is mainly due to additional L2 cache misses during insert request processing.

If both leaf block size and index record size are increased while keeping their ratio constant, the number of index records per leaf block remains the same, but the degree of batching in terms of number of pending requests per fixed-sized disk I/O is still decreased, e.g., the effective number of pending requests committed per 100-KB disk I/O decreases as the leaf block size is increased from 8KB to 64KB, and so is the throughput of the BOSC-based B+ tree index, as shown in Figure 3.6.

0 5000 10000 15000 20000 25000 16 32 48 64 80 96 112 128

Throughput (Unit:Records Per Second)

Index Size (Unit:GB)

Random Insert Workload Random Update Workload Sequential Insert Workload Clustered Insert Workload(Cluster Length: 32)

Figure 3.7: Record insertion/update throughput of a BOSC-based B+ tree imple- mentation under the sequential insertion, clustered insertion, random insertion and random update workload when the initial index size is varied from 16 GB to 128 GB. The Y axis shows the number of new records inserted/updated per second. The memory allocated for all per-block request queues is 1 GB, the record size is 64 B, and the leaf block size is 16 KB.

As the total B+tree index size is increased, the average number of pending requests accumulated in each per-block queue within one sequential commit cycle becomes smaller, the degree of batching at the time of commit is thus

0 5000 10000 15000 20000 25000 200 400 600 800 1000 1200 1400 1600

Throughput (Unit:Records Per Second)

Buffer Memory (Unit:MB) Random Workload Sequential Workload Clustered Workload(Cluster Length: 32)

Figure 3.8: Record insertion throughput of a BOSC-based B+ tree implementation

under the sequential insertion, clustered insertion, and random insertion workload when the BOSC’s buffer memory is varied from 512 MB to 1536 MB. The Y axis shows the number of new records inserted per second. The record size is 64 B, the leaf block size is 64 KB, and the initial index size is 128 GB.

decreased, and so is the throughput of the BOSC-based B+ tree index, as shown in Figure 3.7. The throughput impact of the index size is less obvious under the sequential insert workload because the degree of batching remains largely constant regardless of the index size. Figure 3.7 also shows that the performance of the BOSC-based B+ tree implementation under the random

update workload is almost the same as that under the random insert workload, because in both cases accesses to the index pages are random and consequently their performance is bottlenecked by disk I/O.

As the buffer memory for per-block request queues is increased, the number of pending requests at the time of commit is increased, the degree of batching is increased, and the overall throughput under the random insert and clustered insert workload are increased, as shown in Figure 3.8. The performance impact of buffer memory size is minimal for the sequential insert workload because its degree of batching is largely unaffected by the buffer memory size.

For the random workload, there is a significant increase in throughput when the total queue memory is increased from 512MB to 1GB because IO domi- nates. But from 1G to 1.5G, the increase is not linear because the throughput is reaching its maximum. For the cluster workload, the increase is not linear because the average queue size does not increase linearly. For the sequential workload, the throughput does not change much because the memory is not

the performance bottleneck.