라이브러리
[PHP] Memcache::getServerStatus - 서버 상태를 반환합니다.
Memcache::getServerStatus
Memcache는 PHP에서 사용할 수 있는 분산 메모리 캐시 시스템입니다. Memcache::getServerStatus는 Memcache 서버의 현재 상태를 확인하는 함수입니다.
# 사용법
Memcache::getServerStatus 함수는 Memcache 서버의 현재 상태를 배열로 반환합니다. 이 배열에는 Memcache 서버의 상태, 사용 가능한 메모리 크기, 현재 연결된 클라이언트 수, 그리고 더 많은 정보가 포함됩니다.
# 예제
#hostingforum.kr
php
// Memcache 서버를 연결합니다.
$memcache = new Memcache;
$memcache->addServer('localhost', 11211);
// Memcache 서버의 현재 상태를 확인합니다.
$serverStatus = $memcache->getServerStatus();
// 상태를 출력합니다.
print_r($serverStatus);
# 결과
#hostingforum.kr
php
Array
(
[status] => 0 // 서버 상태 (0: 정상, 1: 에러)
[uptime] => 1234567890 // 서버 가동 시간 (초)
[pid] => 1234 // 서버 PID
[time] => 1234567890 // 서버 시간 (초)
[rusage_user] => 10.5 // 사용자 CPU 시간 (초)
[rusage_system] => 5.2 // 시스템 CPU 시간 (초)
[rusage_maxrss] => 1024 // 최대 메모리 사용량 (KB)
[rusage_ixrss] => 512 // 인터프리터 메모리 사용량 (KB)
[rusage_idrss] => 256 // 데이터 메모리 사용량 (KB)
[rusage_isrss] => 128 // 인터프리터 스택 메모리 사용량 (KB)
[rusage_minflt] => 1000 // 페이지 폴트 수
[rusage_majflt] => 50 // 페이지 교체 수
[rusage_inblock] => 2000 // 읽은 블록 수
[rusage_oublock] => 1000 // 쓴 블록 수
[rusage_msgsnd] => 500 // 보낸 메시지 수
[rusage_msgrcv] => 250 // 받은 메시지 수
[rusage_nsignals] => 10 // 받은 신호 수
[rusage_nvcsw] => 20 // 교환한 프로세스 수
[rusage_nivcsw] => 5 // 교환한 인터프리터 프로세스 수
[connections] => 10 // 현재 연결된 클라이언트 수
[cmd_get] => 100 // GET 명령어 수
[cmd_set] => 50 // SET 명령어 수
[cmd_flush] => 5 // FLUSH 명령어 수
[cmd_touch] => 10 // TOUCH 명령어 수
[get_hits] => 80 // GET 명령어의 히트 수
[get_misses] => 20 // GET 명령어의 미스 수
[delete_hits] => 5 // DELETE 명령어의 히트 수
[delete_misses] => 10 // DELETE 명령어의 미스 수
[incr_hits] => 10 // INCR 명령어의 히트 수
[incr_misses] => 5 // INCR 명령어의 미스 수
[decr_hits] => 5 // DECR 명령어의 히트 수
[decr_misses] => 10 // DECR 명령어의 미스 수
[cas_hits] => 20 // CAS 명령어의 히트 수
[cas_misses] => 10 // CAS 명령어의 미스 수
[flush_hits] => 5 // FLUSH 명령어의 히트 수
[flush_misses] => 10 // FLUSH 명령어의 미스 수
[get_key] => 100 // GET KEY 명령어 수
[get_pattern] => 50 // GET PATTERN 명령어 수
[get_random] => 10 // GET RANDOM 명령어 수
[get_specific] => 20 // GET SPECIFIC 명령어 수
[get_stats] => 5 // GET STATS 명령어 수
[get_version] => 10 // GET VERSION 명령어 수
[get_help] => 5 // GET HELP 명령어 수
[get_debug] => 10 // GET DEBUG 명령어 수
[get_info] => 20 // GET INFO 명령어 수
[get_stats_detail] => 5 // GET STATS DETAIL 명령어 수
[get_stats_reset] => 10 // GET STATS RESET 명령어 수
[get_stats_total] => 20 // GET STATS TOTAL 명령어 수
[get_stats_time] => 5 // GET STATS TIME 명령어 수
[get_stats_memory] => 10 // GET STATS MEMORY 명령어 수
[get_stats_disk] => 20 // GET STATS DISK 명령어 수
[get_stats_network] => 5 // GET STATS NETWORK 명령어 수
[get_stats_io] => 10 // GET STATS IO 명령어 수
[get_stats_cpu] => 20 // GET STATS CPU 명령어 수
[get_stats_thread] => 5 // GET STATS THREAD 명령어 수
[get_stats_process] => 10 // GET STATS PROCESS 명령어 수
[get_stats_system] => 20 // GET STATS SYSTEM 명령어 수
[get_stats_user] => 5 // GET STATS USER 명령어 수
[get_stats_group] => 10 // GET STATS GROUP 명령어 수
[get_stats_all] => 20 // GET STATS ALL 명령어 수
[get_stats_all_detail] => 5 // GET STATS ALL DETAIL 명령어 수
[get_stats_all_reset] => 10 // GET STATS ALL RESET 명령어 수
[get_stats_all_total] => 20 // GET STATS ALL TOTAL 명령어 수
[get_stats_all_time] => 5 // GET STATS ALL TIME 명령어 수
[get_stats_all_memory] => 10 // GET STATS ALL MEMORY 명령어 수
[get_stats_all_disk] => 20 // GET STATS ALL DISK 명령어 수
[get_stats_all_network] => 5 // GET STATS ALL NETWORK 명령어 수
[get_stats_all_io] => 10 // GET STATS ALL IO 명령어 수
[get_stats_all_cpu] => 20 // GET STATS ALL CPU 명령어 수
[get_stats_all_thread] => 5 // GET STATS ALL THREAD 명령어 수
[get_stats_all_process] => 10 // GET STATS ALL PROCESS 명령어 수
[get_stats_all_system] => 20 // GET STATS ALL SYSTEM 명령어 수
[get_stats_all_user] => 5 // GET STATS ALL USER 명령어 수
[get_stats_all_group] => 10 // GET STATS ALL GROUP 명령어 수
[get_stats_all_all] => 20 // GET STATS ALL ALL 명령어 수
)
# 참고
Memcache::getServerStatus 함수는 Memcache 서버의 현재 상태를 확인하는 함수입니다. 이 함수는 Memcache 서버의 상태, 사용 가능한 메모리 크기, 현재 연결된 클라이언트 수, 그리고 더 많은 정보를 반환합니다. 이 함수를 사용하여 Memcache 서버의 상태를 확인하고, 문제가 발생한 경우 해결할 수 있습니다.
-
- 나우호스팅 @pcs8404
-
호스팅포럼 화이팅!
댓글목록
등록된 댓글이 없습니다.