160 likes | 241 Views
Hardware Counter Driven On-the-Fly Request Signatures. Kai Shen Ming Zhong Sandhya Dwarkadas Chuanpeng Li Christopher Stewart Xiao Zhang University of Rochester. Motivation. Hardware counters on modern processors:
E N D
Hardware Counter Driven On-the-Fly Request Signatures Kai Shen Ming Zhong Sandhya Dwarkadas Chuanpeng Li Christopher Stewart Xiao Zhang University of Rochester
Motivation • Hardware counters on modern processors: • instruction mix, rate of execution, branch prediction accuracy, memory access behavior • Operating system utilization of hardware counter metrics • Advantages as fine-grain workload signatures: • application-transparency compared to application statistics • consistent availability compared to OS software statistics • free fine-grain counter maintenance compared to software statistics in general ASPLOS 2008
On-the-Fly Request Signatures • Identifying requests for server workloads • On-the-fly: identify a request while it still executes • Utilizations: • Predicting request properties to guide OS adaptations • Classifying requests on-the-fly to detect anomalies ASPLOS 2008
Challenges • Hardware metrics as workload signatures in server system environments • fluctuating concurrency and frequent context switches ⇒ unstable hardware execution characteristics • requests are fine-grain workload units • Tracking request contexts within the OS • on-the-fly • transparent to applications ASPLOS 2008
Hardware Metrics As Request Signatures:ChoosingNormalization Base • Acquiring stable metrics as request executes: • time-normalized metrics: divide by elapsed CPU cycles • progress-normalized metrics: divide by retired instructions • Finding: • time-normalization for “time duration”-style metrics (e.g., trace cache deliver mode) ASPLOS 2008
Hardware Metrics As Request Signatures:Choosing Effective Metrics • Environmental dynamics: • concurrent request execution in server environments • hardware resource-sharing – multi-threading and multi-core • Example metrics that are significantly affected: ASPLOS 2008
Hardware Metrics As Request Signatures • Metric effectiveness across different applications • inconsistent (e.g., floating-point ops very useful for some but useless for others) ⇒Disappointing result: difficult to find a small set of universally effective metrics • Require application-specific calibration ASPLOS 2008
OS Support of Request Context Tracking • On-the-fly transparent tracking of request contexts • Resource containers [Banga et al.’99] – not application-transparent • Magpie [Barham et al.’04] – not on-the-fly • High-level guidance: • component activities reachable through control or data flows are semantically related, and thus likely part of one request • One case: propagate request context through message passing • tag messages with senders’ request context IDs • handle asynchronous messages, clarify message boundaries in stream-based communications ASPLOS 2008
Example of Request Context Propagation • Multi-tier RUBiS • web server • application components • database • Entirely at the OS • transparent to application ASPLOS 2008
Signature-driven Request Identification • Request identification: • maintain a bank of recent past requests • signature is a vector of metric statistics • match each new request with banked requests on-the-fly • Property inference: • infer the property of new request using the property of matched past request ASPLOS 2008
Prototype • Platform • Linux 2.6.10/Intel Xeon processors with hyper-threading • Overhead (not yet optimized): ASPLOS 2008
Evaluation Results:Accuracy of Predicting Request CPU Time • Comparison base (running average): the average properties of recent past requests to predict future requests ASPLOS 2008
Utilization:Shortest-Job-First Scheduling • 15-27% shorter response time than running average • perform similar to oracle ASPLOS 2008
Utilization:Request Classification and Anomaly Detection • Dots are normal TPC-H requests • Circles are anomalies (SQL injection attacks) • 10-ms cumulative metrics ASPLOS 2008
Related Work • Other uses of hardware counters • phase detection [Dhodapkar&Smith’02, Sherwood et al.’03] • behavior prediction [Duesterwald et al.’03, Bulpin&Pratt’05] • anomaly tracking [Sweeney et al.’04] ⇒we handle challenges due to dynamic server environments • Request characterization using system software metrics • tracking request/response [Aguilera et al.’03] • request modeling [Barham et al.’04] • failure diagnosis [Chen et al.’04] ⇒hardware metrics have unique advantages: consistent availability, free fine-grain counter maintenance First to realize on-the-fly request signatures for server workloads. ASPLOS 2008
Conclusion • Our contributions: • investigate the effectiveness of hardware counter metrics as request signatures in dynamic server environments • propose OS mechanism to support on-the-fly request context tracking and adaptation • demonstrate the effectiveness of request signature-enabled on-the-fly OS exploitations • High-level takeaway: • OS exploitation of hardware metrics to improve performance and dependability [HotOS’07] ASPLOS 2008