1. OPcache 정보 보기
<?php
$status = opcache_get_status();
echo json_encode($status, JSON_PRETTY_PRINT);
?>
2. 항목 설명
The opcache_get_status function in PHP returns an associative array containing information about the current status of the OPcache (Opcode Cache). Each key in the array represents a different aspect of the OPcache status. Here are some common items that you might find in the opcache_get_status results:
- opcache_enabled:
- Description: Indicates whether OPcache is enabled or not.
- Possible Values: true if enabled, false if disabled.
- cache_full:
- Description: Indicates whether the OPcache shared memory is full.
- Possible Values: true if the shared memory is full, false otherwise.
- restart_pending:
- Description: Indicates whether a restart of the OPcache is pending.
- Possible Values: true if a restart is pending, false otherwise.
- restart_in_progress:
- Description: Indicates whether a restart of the OPcache is currently in progress.
- Possible Values: true if a restart is in progress, false otherwise.
- memory_usage:
- Description: Provides information about memory usage in the OPcache (unit : bytes).
- Items:
- used_memory: Amount of memory used by the OPcache.
- free_memory: Amount of free memory in the OPcache.
- wasted_memory: Amount of memory wasted by fragmentation.
- interned_strings_usage:
- Description: Information about interned strings, which are unique string values stored in a single memory location to reduce duplication.
- Items:
- buffer_size: Size of the interned strings buffer.
- used_memory: Amount of memory used by interned strings.
- free_memory: Amount of free memory in the interned strings buffer.
- number_of_strings: Number of interned strings.
- opcache_statistics:
- Description: Provides statistical information about the OPcache.
- Items:
- num_cached_scripts: Number of scripts cached by OPcache.
- num_cached_keys: Number of cache keys (unique script identifiers).
- max_cached_keys: Maximum number of cache keys allowed.
- hits: Number of cache hits.
- misses: Number of cache misses.
- blacklist_misses: Number of blacklist misses (scripts excluded from caching).
- blacklist_miss_ratio: Ratio of blacklist misses to total cache misses.
- opcache_hit_rate: Ratio of cache hits to total access attempts.
These are some of the common items you might find in the opcache_get_status results. The exact list may vary depending on your PHP version and configuration. Always refer to the PHP documentation for the specific version you are using for the most accurate and up-to-date information.
'개발 > PHP' 카테고리의 다른 글
[PHP] PHP의 철학 (0) | 2024.02.22 |
---|---|
[PHP] Composer 사용법 (0) | 2023.08.08 |
PHP opcache 적용 (0) | 2023.02.20 |
[PHP] PHP-FPM 적용하기 (Centos7) (0) | 2023.02.17 |
[PHP] 윈도우에서 php 7.4로 업그레이드 및 VScode 디버깅 설정 (0) | 2023.02.07 |