• No se han encontrado resultados

PARTE I. MARCO TEÓRICO

CAPITULO 2. ADOLESCENCIA Y VALORES

2.4. Diferencias de la perspectiva de los valores por género en adolescentes

customer data returns a result about 2 megabytes in size; selecting all 10 districts produces the expected 20 megabyte result. TPC-C’s customer table is a representative sample because it has a good mix of data types.

System Query Size Time Result Size Total Bytes MS per MB

MySQL5.1 1 district 177ms 1.63MB 1.63MB 108ms/MB

PassThru 1 district 404ms 1.83MB 3.46MB 116ms/MB

MySQL5.1 10 districts 2099ms 16.3MB 16.3MB 129ms/MB

PassThru 10 districts 4481ms 18.3MB 34.6MB 130ms/MB Table 6.1: Performance implications of bandwidth overhead for large results.

By interposing a byte-counting proxy between the client and the database (or PassThrough), we can measure the total bytes sent by the various JDBC protocols.

Table 6.1 shows the results of the experiment. As expected, the PassThrough exhibits half the performance of the stand-alone case, as the result must be sent twice: once to the PassThrough and then again to the client. The overall time is governed by total bytes sent (ms per MB of result is comparable). Our result set implementation is slightly less efficient than MySQL for large results (it takes 12% more bytes to send the same result). As is evident from the data from running TPC-C, our JDBC protocol is more efficient for small result sets: when selecting a single row from the customer table, MySQL’s result size is 1951 bytes compared with PassThru’s 1002 bytes, for a saving of 49%.

One optimization that we could apply, but have not implemented, is pipelined result relay. The JDBC protocol supports incremental fetching of result sets. By requesting the result in chunks and sending each chunk to the client as it arrives, we could hide some of the latency associated with large results. However, not all JDBC drivers support this component of the protocol.

the Shepherd implements. The performance of the various schemes depends on the amount of contention in the workload. We produced a number of different contention scenarios by varying the number of TPC-C warehouses. For each scenario, we ran TPC-C directly against the database to determine the zero overhead performance, and also through the PassThrough to determine the maximum middleware performance.

Figures 6-4, 6-5, and 6-6 show the results of these tests in comparison to the various concurrency control schemes implemented by the shepherd.

Assuming sufficient CPU and network bandwidth, the major performance differ-ence betweenCBSand PassThrough is that CBS must wait for agreement at commit.

The additional wait time adds to transaction duration, which reduces overall perfor-mance, especially for high contention workloads. The results for high contention work-loads (Figure 6-4: 1 and 3 warehouses) show that the extra latency introduced by CBS at the commit point reduces performance 30-40%. In these cases, the PassThrough also performs badly; CBS is only 11-17% slower than the PassThrough. However, workloads without high contention (Figure 6-5,6-6: 10 and 30 warehouses) show CBS having only 10-15% overall performance loss.

TheProntoscheme results in longer wait times at commit than CBS, as it does not pipeline execution on the secondaries with execution on the primary. When Pronto reaches the commit point, it must wait for the all secondaries to execute the entire transaction. Furthermore, the secondaries execute transactions sequentially, ensuring that there is at least a full transaction execution latency between transaction commits on the coordinator. By contrast, CBS can commit batches of transactions at the same time; in some of the tests reaching an average batch size of 7 transactions.

With high contention, the system is sensitive to small increases in latency. Our low contention cases occur when the database is I/O limited and transaction execution time becomes significant. Thus, Pronto performs worse than CBS under both high and low contention.

The performance of the Explicit Partitioning scheme is entirely dependent on the granularity of the partitioning. Our partitioning scheme uses warehouse as the partitions, acquiring all partition locks upfront in ascending warehouse order, so as to

0 20 40 60 80 100

0 5 10 15 20 25 30 35 40

Transactions per second

Clients

TPC-C, 1 warehouse, no wait time

MySQL 5.1 PassThrough Shepherd 3DBs, CBS Shepherd 3DBs, Partition

Shepherd 3DBs, Pronto Shepherd 3DBs, TableLocking Shepherd 3DBs, Serial

0 50 100 150 200

0 5 10 15 20 25 30 35 40

Transactions per second

Clients

TPC-C, 3 warehouses, no wait time

MySQL 5.1 PassThrough Shepherd 3DBs, CBS Shepherd 3DBs, Partition

Shepherd 3DBs, Pronto Shepherd 3DBs, TableLocking Shepherd 3DBs, Serial

Figure 6-4: TPC-C with 1 and 3 Warehouses, comparing replication methods

0 50 100 150 200 250

0 5 10 15 20 25 30 35 40

Transactions per second

Clients

TPC-C, 5 warehouses, no wait time

MySQL 5.1 PassThrough Shepherd 3DBs, CBS

Shepherd 3DBs, Pronto Shepherd 3DBs, TableLocking Shepherd 3DBs, Serial

0 20 40 60 80 100

0 5 10 15 20 25 30 35 40

Transactions per second

Clients

TPC-C, 10 warehouses, no wait time

MySQL 5.1 PassThrough Shepherd 3DBs, CBS

Shepherd 3DBs, Pronto Shepherd 3DBs, TableLocking Shepherd 3DBs, Serial

Figure 6-5: TPC-C with 5 and 10 Warehouses, comparing replication methods

0 5 10 15 20 25

0 5 10 15 20 25 30 35 40

Transactions per second

Clients

TPC-C, 30 warehouses, no wait time

MySQL 5.1 PassThrough Shepherd 3DBs, CBS Shepherd 3DBs, Partition

Shepherd 3DBs, Pronto Shepherd 3DBs, TableLocking Shepherd 3DBs, Serial

Figure 6-6: TPC-C with 30 warehouses, comparing replication methods

avoid deadlocks. With only 1 warehouse, the partitioning scheme is identical to serial.

With 30 warehouses, the number of partitions is sufficient to keep the database busy and partitioning performs very well. Deadlocks between multi-partition transactions can significantly affect performance, but all partitions touched by a transaction are known upfront for the TPC-C workload, thus allowing deadlocks to be avoided. Multi-partition transactions make up about 11% of the workload.

Table Lockingperforms poorly on TPC-C because most transactions involve writes to the same table. Specifically, the New Order and Payment transactions, which account for 88% of the workload, both write to the district table. Thus, Table Locking performs only slightly better than serial execution. Our implementation of TPC-C carefully orders table accesses to minimize deadlocks, but we had to add an explicit table lock acquire to the delivery transaction due to an inherent cycle between new_order and delivery transactions. When the Table Locking scheme experiences deadlocks, its performance drops below that of Serial.

Serial execution restricts performance to that of a single client, regardless of how many clients are present in the test. In our experiments, this results in performance 2 and 5 times worse than a stand-alone database. In all but the highest contention test, CBS beats serial by a factor of 2 to 3.

In summary, Commit Barrier Scheduling performs well in comparison to both the PassThrough and alternative schemes for concurrency control. CBS matches or beats the performance of Explicit Partitioning without any help from the client. Improv-ing the performance of the PassThrough will likely provide significant performance improvements for CBS as well.