이 문서에서는 Compute Engine의 성능 모니터링 장치(PMU)의 동작, 결제, 제한사항을 설명합니다. C4A 또는 C4 가상 머신(VM) 인스턴스에서 PMU를 사용 설정하는 방법을 알아보려면 VM에서 PMU 사용 설정을 참고하세요.
PMU는 CPU 코어 내 하드웨어 구성요소로, 프로세서가 코드를 실행하는 방식을 모니터링합니다. C4A 또는 C4 VM에서 PMU를 사용 설정하면 성능 모니터링 소프트웨어를 사용하여 PMU의 성능 카운터에 액세스할 수 있습니다. 이 접근 방식을 사용하면 애플리케이션의 성능 병목 현상을 파악하고 해결하여 고성능 컴퓨팅(HPC) 또는 머신러닝(ML) 워크로드와 같이 성능에 민감한 워크로드를 최적화할 수 있습니다.
PMU 작동 방식
PMU는 성능 모니터링 카운터(PMC)라고 하는 일련의 하드웨어 카운터로 구성됩니다. 이러한 카운터는 CPU 내에서 브랜치 오류 예측 또는 캐시 부적중과 같은 하위 수준 프로세서 이벤트가 발생할 때마다 계산하는 모델 특정 레지스터입니다. Intel VTune Profiler와 같은 성능 모니터링 소프트웨어를 사용하여 PMU에서 PMC를 읽고 구성할 수 있습니다.
기본적으로 PMU는 VM 내에서 사용 중지됩니다. 이를 사용 설정하려면 다음 PMU 유형 중 하나를 사용 설정하여 추적할 하위 수준 CPU 이벤트 유형을 지정합니다.
아키텍처(ARCHITECTURAL): 다음과 같은 아키텍처 성능 이벤트를 측정할 수 있습니다.
중단된 브랜치 명령어: 중단된 브랜치 명령어 수입니다. 이 이벤트를 사용하여 코드 실행을 측정하고 잠재적인 성능 병목 현상을 식별합니다.
중단된 브랜치 누락: 잘못 예측되어 프로세서가 중단되고 가져온 명령이 삭제된 브랜치 명령어 수입니다. 이 이벤트의 수가 많으면 CPU 성능을 최적화할 수 있습니다.
중단된 명령: CPU가 성공적으로 처리한 명령 수입니다. 이 이벤트를 사용하여 CPU의 명령어 처리량을 측정합니다.
하향식 슬롯: 프로세서의 파이프라인 내에 있는 사용 가능한 슬롯 수로, 동시에 명령을 실행하는 데 사용됩니다. 이 이벤트를 사용하여 코드가 프로세서의 리소스를 얼마나 효율적으로 사용하고 있는지 파악합니다.
중지되지 않은 코어 사이클: 전원 관리 또는 중단 등으로 인해 스레드가 중지되지 않은 경우의 코어 사이클 수입니다. 이 이벤트를 사용하여 프로세서의 전반적인 사용량을 평가합니다.
중지되지 않은 참조 주기: 코어가 중지되지 않은 경우의 참조 주기 수입니다(예: 데이터 또는 명령어 가져오기). HLT 또는 MWAIT 명령어를 실행하면 코어가 중지됩니다.
참조 주기는 고정된 빈도로 작동하므로 에너지를 절약하기 위해 프로세서의 속도가 변경되어도 안정적인 시간 참조를 제공합니다. 이 이벤트를 사용하여 태스크에 소비된 시간을 측정하고 코드의 성능 병목 현상을 식별합니다.
표준(STANDARD): 아키텍처 PMU 유형의 모든 이벤트, 레벨 2(L2) 캐시 이벤트를 비롯한 CPU 코어 내의 모든 로컬 이벤트를 측정할 수 있습니다.
고급(ENHANCED): 표준 PMU 유형의 모든 이벤트, 레벨 3(L3) 캐시 이벤트를 비롯한 CPU 코어 외부의 모든 로컬 이벤트를 측정할 수 있습니다.
VM에서 PMU를 사용 설정하면 PMU가 백그라운드에서 실행되어 PMC를 사용하여 성능 이벤트를 지속적으로 모니터링합니다. 원하는 경우 선호하는 성능 모니터링 소프트웨어를 사용하여 특정 PMC의 기준을 구성할 수 있습니다. PMC가 지정된 기준을 초과하면 PMU가 소프트웨어에 알립니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-03(UTC)"],[[["\u003cp\u003eThe Performance Monitoring Unit (PMU) is a hardware component in the CPU core that monitors processor code execution and can be enabled in C4A or C4 virtual machines (VMs) to access performance counters.\u003c/p\u003e\n"],["\u003cp\u003eEnabling the PMU allows users to measure low-level processor events, such as branch mispredictions and cache misses, using performance-monitoring software to help optimize workloads like HPC and ML.\u003c/p\u003e\n"],["\u003cp\u003eThe PMU supports three types of performance monitoring events: Architectural, which measures general events like branch instructions and core cycles; Standard, which also measures local events within the CPU core; and Enhanced, which additionally includes local events outside the CPU core.\u003c/p\u003e\n"],["\u003cp\u003eThe PMU can only be enabled on Google Axion C4A VMs or Intel Xeon Scalable Processor (Emerald Rapids) 5th generation C4 VMs, with the Enhanced PMU type limited to C4 machines with 96 or 192 vCPUs.\u003c/p\u003e\n"],["\u003cp\u003eThere are no additional costs associated with enabling or disabling the PMU in a VM.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nThis document explains the behavior, billing, and limitations of the performance\nmonitoring unit (PMU) in Compute Engine. To learn how to enable the PMU in a\nC4A or C4 virtual machine (VM) instance, see\n[Enable the PMU in VMs](/compute/docs/enable-pmu-in-vms).\n\nThe PMU is a hardware component within the CPU core that monitors how the\nprocessor runs code. By enabling the PMU in a C4A or C4 VM, you can access the\nperformance counters in the PMU using performance-monitoring software. This\napproach lets you optimize performance-sensitive workloads, such as high\nperformance computing (HPC) or machine learning (ML) workloads, by helping you\nidentify and address performance bottlenecks in your applications.\n\nHow the PMU works\n\nThe PMU is composed of a set of hardware counters called performance monitoring\ncounters (PMCs). These counters are\n[model-specific registers](https://en.wikipedia.org/wiki/Model-specific_register)\nthat count each time a low-level processor event, such as a branch misprediction\nor cache miss, occurs within the CPU. You can read and configure PMCs in the PMU\nby using performance-monitoring software such as\n[Intel VTune Profiler](https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html).\n\nBy default, the PMU is disabled within VMs. To enable it, specify the types of\nlow-level CPU events to track by enabling one of the following PMU types:\n\n- **Architectural (`ARCHITECTURAL`)**: You can measure the following\n architectural performance events:\n\n - **Branch instructions retired**: The number of branch instructions\n retired. Use this event to measure your code's execution and identify\n potential performance bottlenecks.\n\n - **Branch misses retired**: The number of branch instructions that were\n mispredicted, causing the processor to stall and discard fetched\n instructions. If you see a high number for this event, then you can\n likely optimize the CPU performance.\n\n - **Instructions retired**: The number of instructions the CPU\n successfully processes. Use this event to measure the CPU's instruction\n throughput.\n\n - **Top down slots**: The number of available slots within a processor's\n pipeline that are used to simultaneously execute instructions. Use this\n event to understand how efficiently your code is using the processor's\n resources.\n\n - **Unhalted core cycles**: The number of core cycles when the thread is\n not halted---for example, due to power management or interrupts. Use\n this event to evaluate the overall usage of the processor.\n\n - **Unhalted reference cycles** : The number of reference cycles when the\n core is not halted---for example, when fetching data or\n instructions. The core is halted when it runs the\n [`HLT` or `MWAIT` instructions](https://en.wikipedia.org/wiki/HLT_(x86_instruction)).\n Reference cycles operate at a fixed frequency, providing a stable time\n reference even when the speed of the processor changes to preserve\n energy. Use this event to measure the time spent on a task and identify\n performance bottlenecks in your code.\n\n- **Standard (`STANDARD`)**: You can measure all events from the Architectural\n PMU type and any local events inside the CPU core, including level 2 (L2)\n cache events.\n\n- **Enhanced (`ENHANCED`)**: You can measure all events from the Standard PMU\n type, any local events outside the CPU core, including level 3 (L3) cache\n events.\n\nAfter you enable the PMU in a VM, the PMU runs in the background, continuously\nmonitoring performance events using PMCs. You can optionally configure\nthresholds for specific PMCs using your preferred performance-monitoring\nsoftware. If a PMC exceeds its designated threshold, then the PMU notifies the\nsoftware.\n\nLimitations\n\nThe PMU has the following limitations:\n\n- You can only enable the PMU in the following CPU platforms:\n\n | | **CPU platform** | **Supported machine series** | **Supported performance events** |\n |---|---------------------------------------------------------------|----------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n | | Google Axion™ Processor | [C4A](/compute/docs/general-purpose-machines#c4a_series) | [Arm Neoverse V2 PMU Guide](https://developer.arm.com/documentation/109709/latest/) |\n | | Intel Xeon Scalable Processor (Emerald Rapids) 5th generation | [C4](/compute/docs/general-purpose-machines#c4_series) | [emeraldrapids_core.json](https://github.com/intel/perfmon/blob/main/EMR/events/emeraldrapids_core.json) |\n\n- You can enable the Enhanced PMU type only in VMs that use a C4 machine type\n with 96 or 192 vCPUs.\n\nPricing\n\nThere are no costs associated with enabling or disabling the PMU in a VM.\n\nWhat's next\n\n- [Enable the PMU in VMs](/compute/docs/enable-pmu-in-vms)\n\n- [Enable the PMU in Google Kubernetes Engine clusters](/kubernetes-engine/docs/how-to/analyzing-cpu-performance-using-pmu)"]]