energy consumption of small database systems
DESCRIPTION
Energy Consumption of small Database Systems. Faculty : Computer Science and Engineering, York University (CA) Course : CSE 6421 - Advanced Database Systems Instructor: Prof. Jarek Gryz Speaker: Benedikt Iltisberger Date : 2010- 12-01. Presentation Time: 35-45 m inutes - PowerPoint PPT PresentationTRANSCRIPT
HochschuleBonn-Rhein-Sieg
Energy Consumption of small Database
Systems
Faculty: Computer Science and Engineering, York University (CA)Course: CSE 6421- Advanced Database SystemsInstructor: Prof. Jarek Gryz
Speaker: Benedikt IltisbergerDate: 2010-12-01
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Presentation Time:35-45 minutes
Questions: I am looking forward to answer your questions during the presentation.
Slide 2
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Agenda of the Presentation What is the topic? Why is it important? How to solve the problem? What do you have to keep in mind? Does it work in the real world? What is the conclusion? What can be done in the future?
Slide 3
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
What is the Topic? Show a way how to measure the
power consumption of a single query!
Slide 4
Speed
EnergyConsumption
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
What are the Scientific Challenges? Never done before[12]
Could/should be implemented in any
DBMS
Multiple factors need to be considered
Upcoming and important research area
Slide 5
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Energy Consumption
Slide 6Source: [7]
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Why is it worth to focus on energy saving? Saving the environment Growing market Job opportunity Saving costs for companies
Energy bills are rising quickly Very important research area in
Europe Interesting from the technical point of
viewSlide 7
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Benchmarking Organizations SPEC
“New SPECweb2009 benchmark adds ability to measure power consumption of web servers” (June 5, 2009)[4]
TPC “Transaction Processing Performance
Council Announces First Results for its TPC-Energy Specification” (July 7, 2010)[5]
Slide 8
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Energy consumption in the IT
Slide 9Source: [6]
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
What have DBs to do with that? Core Service
Delivering data for any business process Store the foundation of a company Need to be accessible 24/7
Today integrated even in small projects
Data warehouses and Data marts Long running energy consuming queries
Slide 10
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Reasons for Decision-Makers1. Reducing costs
2. Keep up a good image (Green IT)1. Innovation
2. Keep up with the times
3. Being faster than competitors
3. Depending on the area of work
4. Additional company policies
Slide 11
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Idea of this Proposal
Estimate the energy consumption of a single query to Compare queries in terms of efficiency Optimize queries for energy saving Get energy information in real time Teach the optimizer to do this task Green IT initiative
Slide 12
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
How to achieve this goal?
DBMS (e.g. DB2) can generate reports about executed queries containing: Original statement -> optimized
statement Access Plan with many details like:
CPU Cost CPU I/O Cost HDD Bufferpool Buffers Main Memory
Slide 13
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
What information is given? IBM DATABASE 2 Explain Table Format
Tool DB2 version: 09.07.3 Detailed information about queries
including Access Plan (also graphical) Original query Optimized Query Detailed information about the different costs Detailed information about tables, indexes, …
Slide 14
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Information from the Statistic File
Slide 15
Database Context:----------------Parallelism: NoneCPU Speed: 1.889377*107
Comm Speed: 100Buffer Pool size: 6000Sort Heap size: 1000Database Heap size: 900Lock List size: 4096Maximum Lock List: 22Average Applications: 1Locks Available: 28835
4) SORT : (Sort)----------------Cumulative Total Cost: 27541.2Cumulative CPU Cost: 5.39421*109
Cumulative I/O Cost: 23667.2Cumulative Re-Total Cost: 27541.1Cumulative Re-CPU Cost: 5.39388*109
Cumulative Re-I/O Cost: 0Cumulative First Row Cost: 27541.2Estimated Bufferpool Buffers: 585
Detailed information: [9, 10, 11]
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Key Metrics in Detail CPU Cost
Instructions needed to execute a query I/O Cost
Number of seeks and page transfers
Bufferpool Buffer Number of used pages
Total Cost Measured in Timerons (proprietary IBM
algo.) Slide 16
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
The Optimizer’s Access Plan
Slide 17
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Slide 18
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Slide 19
| /------------------+------------------\ 18000 211.307 299.933 TABLE: TPCDS ^HSJOIN FETCH ITEM ( 8) ( 18) Q2 26913.4 30.4522 23078.2 4 /----------+-----------\ /---+----\ 13889.9 29221.1 300 300 NLJOIN TBSCAN IXSCAN TABLE: TPCDS ( 9) ( 17) ( 19) PROMOTION 17710.9 9200.94 0.105098 Q1 14832.2 8246 0 /-------+--------\ | | 352.257 39.4311 1.9208e+006 300 TBSCAN FETCH TABLE: TPCDS INDEX: SYSIBM ( 10) ( 13) CUSTOMER_DEMOGRAPHICS SQL100701103316930 723.246 39.5703 Q4 Q1 656 32.9996 | /----+-----\ 352.257 39.4311 2.8804e+006 SORT RIDSCN DP-TABLE: TPCDS ( 11) ( 14) STORE_SALES 723.246 7.59231 Q5 656 1 | | 352.257 39.4311 TBSCAN SORT 3 ( 12) ( 15)
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Parse and Compute
1. Perl script to gather important information Grab all CPU, HDD and Memory operations Sum them up
2. Provide script with following parameters:
Energy consumption of 1 CPU cylce Energy consumption of 1 HDD operation Energy consumption of 1 Memory operation
3. Calculate the query's power consumption
Using the information from no. 1 and no. 2
Slide 20
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Perl Script
Slide 21
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Assumed DB System CPU[1]
Intel Xeon X7560 @2.266 GHz, 130W 8 Cores, 16 Threads, 24MB L3 Cache
HDD[2]
Seagate Cheetah 15K, 600GB, 16MB Cache I/O Data transfer rate 600MB/s, 16.35W (avg operating
power consumption) RAM[6]
4GB DDR3 RAM (2 * 2GB DIMM#) with 9W per DIMM 18W
Additional Hardware[6]: 30% of average power consumption of other components
which leads to (130W + 16.35W + (2 * 9W)) * 0.3 = 49,305W Slide 22Source: [6], Page 1233, Section 3.2
#) DIMM Dual In-Line Memory Module
Overall:213.66W
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
How to measure the parameters? I CPU
Peak power consumption (p) of the manufacturer (Watts per hour)
Total MIPS per hour (c) Calculate avg power consumption (a)
p / c = a
Problems Slide calculation flaws may end in high differences Many instructions take more the one cycle
This also depends on the CPU type Current multicore architecture need special
customizationSlide 23
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
How to measure the parameters? II
Slide 24
HDD Peak power consumption (p) of the
manufacturer (Watts per hour) Calculate the max. avg I/O operations per hour
(c) Calculate avg power consumption per I/O and
hour (a) p / c = a
Problems Different energy consumption for read & write RAID-n or other storage systems
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
How to measure the parameters? III Main Memory
Peak power consumption (p) of the manufacturer (Watts per hour)
Calculate the max. page change rate per hour (c)
Calculate avg power consumption per page change (a)
p / c = a
Problems: Very complicated and inprecise Strongly dependent on memory architecture
and manufacturing processSlide 25
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Exemplary Technical Issue:“Samsung DDR3”
Slide 26
Source: [8]
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Automation of Data Collection about CPU, HDD, RAM Proposal: “energyDB”
Name, Modell, Speed, Energy consumption, …
Online service to provide needed information
Comparable with CDDB[13] or freedb[14]
Useful for other projects as wellSlide 27
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Optimizing Queries Areas of optimization:
Execution speed (typical parameter) When time is relevant
Resource usage For many concurrent users/queries
New: Energy Consumption
Slide 28
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Optimizing Queries No. 1 Original Query:
SELECT i_item_id, CAST(avg(CAST(ss_quantity AS DECFLOAT)) AS DECIMAL(10,6))
agg1, CAST(avg(ss_list_price) AS DECIMAL(10,6)) agg2, CAST(avg(ss_coupon_amt) AS DECIMAL(10,6)) agg3, CAST(avg(ss_sales_price) AS DECIMAL(10,6)) agg4 FROM tpcds.store_sales, tpcds.customer_demographics, tpcds.date_dim, tpcds.item, tpcds.promotion WHERE ss_sold_date_sk = d_date_sk and ss_item_sk = i_item_sk and ss_cdemo_sk = cd_demo_sk and ss_promo_sk = p_promo_sk and cd_gender = 'M' and cd_marital_status = 'S' and cd_education_status = 'College' and (p_channel_email = 'N' or p_channel_event = 'N') and d_year = 2000 GROUP BY i_item_id ORDER BY i_item_id FETCH FIRST 100 ROWS ONLY Slide 29
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Optimizing Queries (Results)
Original Query 1(with index)
Declined Query 1(index deleted)
CPU Cost 4.96336*109 5.39446*109
I/O Cost 8636.78 23667.20
Buffer Pool usage* 68303.99 70816.80
Energy Consumption TBD TBD
Total Cost 12119.3 27541.2
Slide 30
*) Sum of all buffer pool operations for all involved queries.
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Optimizing Queries No. 2 Original Query:
SELECT i_item_id, CAST(avg(CAST(ss_quantity AS DECFLOAT)) AS DECIMAL(10,6))
agg1, CAST(avg(ss_list_price) AS DECIMAL(10,6)) agg2, CAST(avg(ss_coupon_amt) AS DECIMAL(10,6)) agg3, CAST(avg(ss_sales_price) AS DECIMAL(10,6)) agg4
FROM tpcdsnp.store_sales, tpcdsnp.customer_demographics, tpcdsnp.date_dim,
tpcdsnp.item, tpcdsnp.promotion WHERE ss_sold_date_sk = d_date_sk and ss_item_sk = i_item_sk and
ss_cdemo_sk = cd_demo_sk and ss_promo_sk = p_promo_sk and cd_gender = 'M’ and cd_marital_status = 'S' and cd_education_status = 'College' and (p_channel_email = 'N' or p_channel_event = 'N') and d_year = 2000 GROUP BY i_item_id ORDER BY i_item_id FETCH FIRST100 ROWS ONLY
Slide 31
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Optimizing Queries (Results)
Original Query 2(with index)
Declined Query 2(index deleted)
CPU Cost 4.51373*107 1.45693*109
I/O Cost 654.55 8495.00
Buffer Pool usage* 3971.55 17575.20
Energy Consumption TBD TBD
Total Cost 1124.43 8772.47
Slide 32
*) Sum of all buffer pool operations for all involved queries.
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Optimizing Queries (Problems) Better performance but higher energy
usage: Precomputation for faster response times Materialized Views CPU
Cheap in terms of time consumption but Expensive in terms of energy consumption
Slide 33
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Conclusions I Reducing costs is always welcome in
companies High need for this research in the long term
Due to corporate identity and rising energy costs Environmental saving
Query optimization does not necessarily lead to power saving
Proposed technique can be added to the optimizer Slide 34
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Conclusions II
Cons You need to measure the single components in
the first place Not easily applicable to complex systems Accuracy must be determined
Checking results with hardware based measurement data
How to measure VMs?
Slide 35
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Future Work I Add power consumption optimization
techniques directly to the optimizer IBM seems to be working on that[12]
Optional output of estimate power consumption
Improve calculation techniques Even slide inaccuracy can have a big impact RAM usage is pretty inaccurate at the moment
Automization of the processSlide 36
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Future Work II Implementation of complex Dataware
House systems or for distributed database systems
Inaccuracy with measuring multi CPU systems
„energyDB“ web service implementation Impact of hardware power saving
GPU for databases, SSD, Dynamic voltage scaling, ...
Slide 37
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Concluding …This topic is worth for further research!
Slide 38
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Reference:1. http://www.intel.com/p/en_US/products/server/processor/xeon7000/
specifications2. http://www.seagate.com/www/en-us/products/enterprise-hard-drive
s/cheetah-15k#tTabContentSpecifications
3. http://www.gruene-it.de/index.php/2010/09/17/ram-stromverbrauch-server/
4. http://www.spec.org/web2009/press/release.html5. http://www.tpc.org/information/press/tpcpress20100707.asp6. M. Poess, R. O. Nambiar, Energy Cost, “The Key Challenge of
Today’s Data Centers: A Power Consumption Analysis of TPC-C results”,Oracle Corporation and Hewlett-Packard Company, N.A..
Thank you for your attention! Any questions?
Slide 39
HochschuleBonn-Rhein-Sieg Energy Consumption of DB Systems
Reference (cont.):7. http://www.bp.com/liveassets/bp_internet/globalbp/globalbp_uk_en
glish/reports_and_publications/statistical_energy_review_2008/STAGING/local_assets/2010_downloads/statistical_review_of_world_energy_full_report_2010.pdf
8. http://www.samsung.com/global/business/semiconductor/Greenmemory/Applications/ServerStorage/ServerStorage_DDR3.html
9. http://www-01.ibm.com/support/docview.wss?rs=0&uid=swg21207055
10. http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000295.htm
11. http://www.ibm.com/developerworks/data/library/techarticle/0212wieser/index.html
12. http://www.freepatentsonline.com/y2009/0281986.html13. http://www.gracenote.com/14. http://www.freedb.org15. R. Ramahrishnan, J. Gehrke, „Database Management Systems”,
Third Edition, McGraw-Hill, Boston, 2003.
Slide 40