QAMEM: Query Aware Memory Energy Management Srinivasan Chandrasekharan Department of Computer Science University of Arizona Tucson, Arizona 85719 Email: schandra@cs.arizona.edu Chris Gniady Department of Computer Science University of Arizona Tucson, Arizona 85719 Email: gniady@cs.arizona.edu Abstract—As memory becomes cheaper, use of it has become more prominent in computer systems. This increase in number of memory modules increases the ratio of energy consumption by memory to the overall energy consumption of a computer system. As Database Systems become more memory centric and put more pressure on the memory subsystem, managing energy consumption of main memory is becoming critical. Therefore, it is important to take advantage of all memory idle times and lower power states provided by newer memory architectures by placing memory in low power modes using application level cues. While there have been studies on CPU power consumption in Database Systems, only limited research has been done on the role of memory in Database Systems with respect to energy management. We propose Query Aware Memory Energy Management (QAMEM) where the Database System provides application level cues to the memory controller to switch to lower power states using query information and performance counters. Our results show that by using QAMEM on TPC-H workloads one can save 25% of total system energy in comparison to the state of the art memory energy management mechanisms. I. I NTRODUCTION Big-Data Computing is creating revolutionary break- throughs in many scientific areas and commercial applications. Previously challenging questions are being answered currently by the ability to analyze vast amounts of data which allows us to answer scientific questions that were impossible to answer before. Large data analytics is limited by the I/O bandwidth of storage systems. A common panacea for slow I/O is large main memory to buffer data for processing. Subsequently, Big-Data systems are employing larger and larger memories to maintain desired system performance. As expected, the memory subsystem is dominating energy consumption of computing servers. For example, as much as 46% of the total system energy is consumed by the memory subsystem in IBM’s Power7 servers [13]. In the case of in-memory databases, this percentage is even higher and at scale exceeds the power consumption of fully loaded CPUs [1]. Rising costs of energy and its ever increasing consumption has become one of the biggest expense in today’s computing facilities and memory optimizations for energy efficiency are becoming the key component in overall system efficiency. Hardware designers and manufacturers are addressing energy efficiency through higher density manufacturing processes that create denser modules and lower per-bit energy consumption, as well as introduction of additional low-power states that trade performance for energy efficiency. Multiple power states allow the operating system or the application to control the power and performance levels of the memory to maximize efficiency while meeting the performance expectations or guarantees [2]. While the operating system has the ability to control power states, applications can provide more informa- tion about current executing tasks and performance demand from the memory subsystem. Accurate information is critical for designing an efficient mechanism in improving energy efficiency while preventing long power-state transition delays to be exposed to critical execution paths in the application. The need for provenance of data especially in large scale scientific experiments and in commerce has increased the need to capture and store more data from instruments and users. To make sure that this additional data is relevant to previously collected data, scientists often use relational database servers to further analyze the data collected while in commerce this additional data is used for decision support. Relational database servers have therefore become a critical application in big data computing and analytics. One of the most widely used open source relational database servers, PostgreSQL, is often used to store raw data by scientists and commercial operations so they can quickly analyze the data to extract vital information using widely available open source tools for analysis and visualization. To improve energy efficiency of the database servers, we propose Query-Aware Memory Energy Management (QAMEM), a highly accurate and transparent mechanism for memory energy management in database servers. Compared to the existing mechanisms QAMEM provides energy optimiza- tions within the running SQL query using query information, as compared to previous approaches that periodically transition the memory to lower-power modes after restructuring of the query [22]. Subsequently, we make the following contributions in this paper: (1) identify and quantify the memory behavior of a widely used database application, PostgreSQL, and show large opportunity for improvement; (2) design QAMEM that utilizes SQL query information to accurately predict memory demand for queries executed on the database server; (3) com- pare QAMEM with the existing state-of-the-art mechanisms through a detailed study.