PHP OPcache

Supported OS Mac OS Windows

통합 버전0.0.1

개요

이 점검은 Datadog 에이전트를 통해 PHP OPcache를 모니터링합니다.

설정

아래 지침을 따라 호스트에서 실행되는 에이전트에 대해 이 점검을 설치하고 설정하세요. 컨테이너화된 환경의 경우 이러한 지침을 적용하는 데 가이드가 필요하면 오토파일럿 통합 템플릿을 참조하세요.

설치

호스트에서 php_opcache 점검을 설치하려면,

  1. 개발자 툴킷을 설치합니다. 모든 기기에서

  2. ddev -e release build php_opcache를 실행하여 패키지를 빌드합니다.

  3. Datadog 에이전트를 다운로드합니다.

  4. 빌드 아티팩트를 에이전트가 있는 호스트에 업로드합니다. datadog-agent integration install -w path/to/php_opcache/dist/<ARTIFACT_NAME>.whl.

OPcache

OPcache는 기본적으로 메트릭을 노출하지 않으므로 여기 통합에는 메트릭 내보내기가 포함되어 있습니다.

/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/php_opcache/assets/exporter/opcache-dd-handler.php

Datadog integrations-extras 리포지토리에서 내보내기를 다운로드할 수 있습니다.

에이전트를 설정할 때 파일 이름으로 내보내기를 직접 참조하거나 웹 서버에서 별칭을 설정합니다. 예를 들어 Apache를 사용하는 경우 웹 서버 설정 파일의 별칭은 다음과 같습니다.

Alias /opcache-status /opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/php_opcache/assets/exporter/opcache-dd-handler.php
<Location /opcache-status>
    Require all denied
    Require local
</Location>

구성

  1. 에이전트의 설정 디렉토리 루트에 있는 conf.d/ 폴더에 있는 php_opcache.d/conf.yaml 파일을 편집하여 php_opcache 성능 데이터 수집을 시작합니다. 사용 가능한 모든 설정 옵션은 샘플 php_opcache.d/conf.yaml 파일을 참조하세요.
    instances
      - url: http://localhost/opcache-status
    
  2. Agent를 다시 시작합니다.

검증

에이전트의 상태 하위 명령을 실행하고 점검 섹션에서 php_opcache를 찾습니다.

수집한 데이터

메트릭

php_opcache.opcache_enabled
(gauge)
opcache enable flag
php_opcache.cache_full
(gauge)
cache full time
php_opcache.restart_pending
(gauge)
a restart pending
php_opcache.restart_in_progress
(gauge)
restart in progress
php_opcache.memory_usage.used_memory
(gauge)
used memory size
Shown as byte
php_opcache.memory_usage.free_memory
(gauge)
free memory
Shown as byte
php_opcache.memory_usage.wasted_memory
(gauge)
wasted memory
Shown as byte
php_opcache.memory_usage.current_wasted_percentage
(gauge)
current wasted percentage
Shown as percent
php_opcache.interned_strings_usage.buffer_size
(gauge)
interned string buffer size
Shown as byte
php_opcache.interned_strings_usage.used_memory
(gauge)
interned string used memory
Shown as byte
php_opcache.interned_strings_usage.free_memory
(gauge)
interned string free memory
Shown as byte
php_opcache.interned_strings_usage.number_of_strings
(gauge)
interned string number of string
Shown as byte
php_opcache.opcache_statistics.num_cached_scripts
(gauge)
num cached script
Shown as item
php_opcache.opcache_statistics.num_cached_keys
(gauge)
num cached keys
Shown as item
php_opcache.opcache_statistics.max_cached_keys
(gauge)
max cached keys
Shown as item
php_opcache.opcache_statistics.hits
(gauge)
cache hit
Shown as hit
php_opcache.opcache_statistics.start_time
(gauge)
cache start time
Shown as time
php_opcache.opcache_statistics.last_restart_time
(gauge)
last restart time
Shown as time
php_opcache.opcache_statistics.oom_restarts
(gauge)
oom restart count
Shown as occurrence
php_opcache.opcache_statistics.hash_restarts
(gauge)
hash restart count
Shown as occurrence
php_opcache.opcache_statistics.manual_restarts
(gauge)
description
Shown as occurrence
php_opcache.opcache_statistics.misses
(gauge)
number of cache miss
Shown as miss
php_opcache.opcache_statistics.blacklist_misses
(gauge)
number of black list misses
Shown as miss
php_opcache.opcache_statistics.blacklist_miss_ratio
(gauge)
percent of black list miss ratio
Shown as percent
php_opcache.opcache_statistics.opcache_hit_rate
(gauge)
percent of hit ratio
Shown as percent

이벤트

PHP OPcache 통합에는 이벤트가 포함되어 있지 않습니다.

서비스 점검

php_opcache.can_connect
Returns CRITICAL if the Agent is unable to connect to and collect metrics from the monitored OPcache instance. Returns OK otherwise.
Statuses: ok, critical

트러블슈팅

도움이 필요하신가요? Datadog 고객 지원팀에 문의하세요.