Measuring Mysql Server Performance For Sensor Data Stream Processing
Measuring Mysql Server Performance For Sensor Data Stream Processing
27 April 2006
MIT Lincoln Laboratory
MySQL Users Conf.-1 This
work was sponsored by the U.S. Army Space and Missile Defense Command under Air Force Contract# FA8721-05-C-0002.
04-27-2006
Opinions, interpretations, recommendations and conclusions are that of the author and are not necessarily endorsed by the
United States Government.
Outline
• Introduction
• Summary
• Summary
MySQL Users Conf-3
MIT Lincoln Laboratory
04-27-2006
Reagan Test Site (RTS) and its
Instrumentation
– Multiple RF sensors collecting data in several regions of electromagnetic spectrum
ROCC
Data Analysis Activity
Algorithms Displays Simulation
Database
Network
Sensors
Primary operations:
– Manages data flow from multiple sensors
– Analyses the acquired data
– Displays tracks and predicts the path of space objects
– Stores acquired data for later analysis and reporting
– Simulates past and future activities
ROCC
Interface
Historian Alg_1
Box_1
MySQL
server
ROCC
Operational
Interface Alg_M
Box_N Data Store
(ODS)
Messages Queries
Queries
Historian MySQL
subscription threads server ODS
(IMB)
Goals
– Store up to 10 MB/s with various record lengths
– Simulate the asynchronous message generation in the acquisition system
Multiple clients –— one table (M1) Multiple clients –— multiple tables (MM)
Server Table
Client Client
Client
1 … 100 1 … 100
Client Client
Client
Design parameters
– Multiple clients writing into the same table (up to 100 clients)
– Multiple clients writing into different tables (up to 100 tables)
– Different record lengths (from 10 bytes up to 10 MB – 1,000,000 times)
– Reading performance was not the major issue
MySQL Users Conf-9
MIT Lincoln Laboratory
04-27-2006
Testing system configurations
Hardware tested
Quantity CPU Memory Disks Network
2 Quad CPU Opteron, 64-bit, 8 GB RAID 5 SCSI Ultra 320, 300 GB 1 Gb/sec
1 MB Cache 144 GB, 10 K rpm, 4.7 ms
4 Dual CPU Opteron, 64-bit, 4 - 8 GB RAID5, SATA, 250 GB, 80 GB, 7.2 K rpm, 1 Gb/sec
10.9 ms, UltraATA-100, 7.2 K rpm, 11.5 ms
1 MB Cache
2 Single and dual CPU Intel(R) 2 - 3 GB Ultra SCSI 320, 146 GB, 15K rpm, 3.5 ms 1 Gb/sec
Xeon(TM) CPU, 2.0 GHz,
SCSI Ultra 160, 73 GB, 10K rpm, 7.8 ms
2 MB Cache
Software tested
# Operating System MySQL Server Java Client
1 RHEL 4 AS, kernel 2.6.9-5.ELsmp, 64-bit 4.0.18-standard 32/64-bit build 1.4.2_03, 32-bit
2 RHEL 4 ES, kernel 2.6.9-11.ELsmp 32-bit 4.1.11-standard 32/64-bit build 1.4.2_10, 32-bit
• Introduction
• Summary
MySQL Users Conf-18
MIT Lincoln Laboratory
04-27-2006
Client/Server (CS)–based
ROCC architecture
Sensors
ROCC ROCC
Interface Alg_1
Box_1
MySQL server
ROCC
Alg_M
Interface
Box_N
ODS
CS advantages
• “Don’t need special “recording” component (Historian)
• Pull” model—all components get the data when they want them
• The same API for the current and historical data
• Excellent filtering capabilities (SQL)
• High throughput, very simple settings, no load balancing
• Very standard, very low cost, low demand for resources
CS drawbacks
• Data centralization
• More workload for the network – UDP vs. TCP/IP, no multicast
• More workload for the database server
• Require indexes and multilevel queries—more complex requests
……. …….
SELECT * FROM ( SELECT * FROM table1 ORDER BY recordID DESC LIMIT M ) t WHERE t.column1< 300
• Design
– Multiple writing clients write into multiple tables time-stamping each record
– Multiple reading clients read from into different tables while the writing clients
continue to write into the tables
– Reading clients compare each record time stamp with current time
and calculate the latency
MySQL
server
MySQL database
Writing tables 0
Result tables 1 Result tables 2
Throughput = 2 MB/sec, 90% latencies within 100 Throughput = 3 MB/sec, 90% latencies within 40 msec
msec
Throughput = 4 MB/sec, 90% latencies within 100 msec Latencies histograms for writing/reading threads for 4 clients
• Introduction
• Summary
• IMB and EMB were designed to model major data flows in ROCC
• IMB demonstrated:
– Java/MySQL client/server architecture satisfies ROCC requirements
– MySQL 4.1.11 was the fastest version for insertion transactions
– MyISAM showed superior performance relative to InnoDB
– JDK 1.5.0 64-bit delivers much better performance than 1.4.2 32-bit
• EMB demonstrated:
– Java/MySQL-based client/server architecture with appropriate queries
and indexation could be used for ESP applications
– It delivered better throughput and latencies than currently employed
publish/subscribe architecture
– MySQL 5.0.16 exhibited better linearity and performance for large number
of writing/reading threads than 4.1.11 version
• Benchmarks showed that MySQL server is capable to handle both
real-time data recording and real-time event stream processing
MySQL Users Conf-27
MIT Lincoln Laboratory
04-27-2006