PHP 5는 지원이 종료되었으며 2026년 1월 31일에
지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 PHP 5 애플리케이션을 배포할 수 없습니다. 기존 PHP 5 애플리케이션은
지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다.
지원되는 최신 PHP 버전으로 마이그레이션하는 것이 좋습니다.
Memcache 사용
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 Google Cloud 콘솔을 사용하여 애플리케이션에 Memcache 서비스를 구성하고 모니터링하는 방법을 설명합니다. 또한 App Engine Memcache PHP API를 사용하여 캐시된 값을 설정하고 검색하는 방법을 설명합니다. Memcache에 대한 자세한 내용은 Memcache 개요를 참조하세요.
Memcache 구성
- Google Cloud 콘솔에서 Memcache 페이지로 이동합니다.
Memcache 페이지로 이동
사용하려는 Memcache 서비스 수준을 선택합니다.
- 공유(기본값) - 가급적 최대한의 캐시 용량을 확보하여 제공합니다.
- 전용 - 캐시 크기의 GB 시간 단위로 요금이 청구되며, 애플리케이션 전용으로 할당되는 고정 캐시 용량을 제공합니다.
사용 가능한 서비스 등급에 대한 자세한 내용은 Memcache 개요를 참조하세요.
값 캐싱 및 검색
값 캐싱
Memcache::set
을 사용하여 키 값을 추가합니다.
캐시된 값 조회
Memcache::get
을 사용하여 단일 키 값을 조회합니다.
Google Cloud 콘솔에서 Memcache 모니터링
- Google Cloud 콘솔에서 Memcache 페이지로 이동합니다.
Memcache 페이지로 이동
- 다음 보고서를 확인합니다.
- Memcache 서비스 수준: 애플리케이션이 공유 서비스 수준을 사용하고 있는지 아니면 전용 서비스 수준을 사용하고 있는지를 표시합니다.
프로젝트 소유자는 두 수준 간에 전환할 수 있습니다. 자세한 내용은 서비스 수준을 참조하세요.
- 적중률: 캐시에서 제공된 데이터 요청의 비율과 더불어 캐시에서 제공된 데이터 요청의 총 개수를 보여줍니다.
- 캐시의 항목 수
- 가장 오래된 항목의 유지 기간: 가장 오래된 캐시된 항목의 유지 기간입니다. 항목의 유지 기간은 항목이 사용(읽기 또는 쓰기)될 때마다 재설정됩니다.
- 총 캐시 크기
다음과 같은 작업을 수행할 수 있습니다.
- 새 키: 캐시에 새 키를 추가합니다.
- 키 찾기: 기존 키를 검색합니다.
- 캐시 삭제: 캐시에서 모든 키-값 쌍을 삭제합니다.
(전용 Memcache에만 해당) 핫 키 목록을 살펴봅니다.
- '핫 키'는 Memcache에서 수신 QPS(초당 쿼리 수)가 100을 초과하는 키입니다.
- 이 목록에는 최대 100개의 핫 키가 QPS가 많은 순서대로 포함됩니다.
다음 단계
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-09-04(UTC)
[[["이해하기 쉬움","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-04(UTC)"],[[["\u003cp\u003eThis page guides users on configuring and monitoring the memcache service for applications using the Google Cloud console, as well as utilizing the App Engine Memcache PHP API for caching.\u003c/p\u003e\n"],["\u003cp\u003eMemcache offers two service levels, Shared and Dedicated, with the former being free and the latter providing a fixed, billed cache capacity.\u003c/p\u003e\n"],["\u003cp\u003eUsers can cache values using \u003ccode\u003eMemcache::set\u003c/code\u003e and retrieve cached values using \u003ccode\u003eMemcache::get\u003c/code\u003e via the App Engine Memcache PHP API.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Cloud console allows for monitoring of the memcache service level, hit ratio, cache items, oldest item age, and total cache size, and offers actions like adding, finding, or flushing keys.\u003c/p\u003e\n"],["\u003cp\u003eDedicated memcache provides a hot key list for keys that receives more than 100 queries per second.\u003c/p\u003e\n"]]],[],null,["# Using Memcache\n\nThis page describes how to configure and monitor the memcache service for your\napplication using the Google Cloud console. It also describes how to use the\nApp Engine Memcache PHP API to set and retrieve cached values. To learn more about memcache,\nread the [Memcache Overview](/appengine/docs/legacy/standard/php/memcache).\n\n\u003cbr /\u003e\n\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| php-gen2\n|\n| /services/access). If you are updating to the App Engine PHP 7/8 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/php-differences) to learn about your migration options for legacy bundled services.\n\nConfiguring memcache\n--------------------\n\n1. Go to the Memcache page in the Google Cloud console. \n [Go to the Memcache page](https://console.cloud.google.com/appengine/memcache)\n2. Select the memcache service level you want to use:\n\n - **Shared** (default) - free and provides cache capacity on a best-effort basis.\n - **Dedicated** - billed by the GB-hour of cache size and provides a fixed cache capacity assigned exclusively to your application.\n\n Learn more about available service classes in [Memcache Overview](#service_levels).\n\nCaching and retrieving values\n-----------------------------\n\n### Caching a value\n\nUse [`Memcache::set`](http://php.net/manual/en/memcache.set.php) to add a key's\nvalue: \n\n $memcache = new Memcache;\n $value = $request-\u003egetContent();\n return $memcache-\u003eset($key, $value);\n\n### Looking up cached values\n\nUse [`Memcache::get`](http://php.net/manual/en/memcache.get.php) to look up the\nvalue of a single key: \n\n $memcache = new Memcache;\n return $memcache-\u003eget($key);\n\nMonitoring memcache in the Google Cloud console\n-----------------------------------------------\n\n1. Go to the Memcache page in the Google Cloud console. \n [Go to the Memcache page](https://console.cloud.google.com/appengine/memcache) \n2. Look at the following reports:\n - **Memcache service level** : Shows if your application is using the Shared or Dedicated service level. If you are an owner of the project, you can switch between the two. Learn more about the [service levels](./#service_levels).\n - **Hit ratio**: Shows the percentage of data requests that were served from the cache, as well as the raw number of data requests that were served from the cache.\n - **Items in the cache**.\n - **Oldest item age**: The age of the oldest cached item. Note that the age of an item is reset every time it is used, either read or written.\n - **Total cache size**.\n3. You can take any of the following actions:\n\n - **New key**: Add a new key to the cache.\n - **Find a key**: Retrieve an existing key.\n - **Flush cache**: Remove all the key-value pairs from the cache.\n4. (Dedicated memcache only) Look through the list of **Hot keys**.\n\n - \"Hot keys\" are keys that receive more than 100 queries per second (QPS) in the memcache.\n - This list includes up to 100 hot keys, sorted by highest QPS.\n\nWhat's next\n-----------\n\n- Learn more about memcache in the [Memcache Overview](/appengine/docs/legacy/standard/php/memcache).\n- Refer to the documentation for the [Memcache](http://php.net/manual/en/book.memcache.php) and [Memcached](https://php.net/manual/en/book.memcached.php) APIs."]]