Memcached

Memcached (libmemcached 기반 캐시 클라이언트)

동적 웹 애플리케이션을 빠르게 만들기 위해 DB 부하를 줄이는 메모리 캐시가 필요하다면 이 확장을 쓰면 돼요. memcached는 고성능·분산 메모리 객체 캐싱 시스템이고, 이 확장은 그 memcached 서버와 통신하기 위해 libmemcached 라이브러리를 사용해요. 세션 핸들러(memcached)도 제공해요.

출처: Memcached

본문

소개

memcached는 고성능·분산 메모리 객체 캐싱 시스템으로, 본질적으로는 일반적인(generic) 용도지만 동적 웹 애플리케이션을 빠르게 하기 위해 DB 부하를 덜어 주는 데 쓰도록 만들어졌어요.

이 확장은 memcached 서버와 통신하기 위한 API를 제공하기 위해 libmemcached 라이브러리를 사용해요. 세션 핸들러(memcached)도 함께 제공하죠.

libmemcached에 대한 정보는 http://libmemcached.org/libMemcached.html 에서 찾아볼 수 있어요.

함수 참조

메서드 (Memcached 클래스)

  • Memcached::add — Add an item under a new key
  • Memcached::addByKey — Add an item under a new key on a specific server
  • Memcached::addServer — Add a server to the server pool
  • Memcached::addServers — Add multiple servers to the server pool
  • Memcached::append — Append data to an existing item
  • Memcached::appendByKey — Append data to an existing item on a specific server
  • Memcached::cas — Compare and swap an item
  • Memcached::casByKey — Compare and swap an item on a specific server
  • Memcached::__construct — Create a Memcached instance
  • Memcached::decrement — Decrement numeric item's value
  • Memcached::decrementByKey — Decrement numeric item's value, stored on a specific server
  • Memcached::delete — Delete an item
  • Memcached::deleteByKey — Delete an item from a specific server
  • Memcached::deleteMulti — Delete multiple items
  • Memcached::deleteMultiByKey — Delete multiple items from a specific server
  • Memcached::fetch — Fetch the next result
  • Memcached::fetchAll — Fetch all the remaining results
  • Memcached::flush — Invalidate all items in the cache
  • Memcached::get — Retrieve an item
  • Memcached::getAllKeys — Gets the keys stored on all the servers
  • Memcached::getByKey — Retrieve an item from a specific server
  • Memcached::getDelayed — Request multiple items
  • Memcached::getDelayedByKey — Request multiple items from a specific server
  • Memcached::getMulti — Retrieve multiple items
  • Memcached::getMultiByKey — Retrieve multiple items from a specific server
  • Memcached::getOption — Retrieve a Memcached option value
  • Memcached::getResultCode — Return the result code of the last operation
  • Memcached::getResultMessage — Return the message describing the result of the last operation
  • Memcached::getServerByKey — Map a key to a server
  • Memcached::getServerList — Get the list of the servers in the pool
  • Memcached::getStats — Get server pool statistics
  • Memcached::getVersion — Get server pool version info
  • Memcached::increment — Increment numeric item's value
  • Memcached::incrementByKey — Increment numeric item's value, stored on a specific server
  • Memcached::isPersistent — Check if a persistent connection to memcache is being used
  • Memcached::isPristine — Check if the instance was recently created
  • Memcached::prepend — Prepend data to an existing item
  • Memcached::prependByKey — Prepend data to an existing item on a specific server
  • Memcached::quit — Close any open connections
  • Memcached::replace — Replace the item under an existing key
  • Memcached::replaceByKey — Replace the item under an existing key on a specific server
  • Memcached::resetServerList — Clears all servers from the server list
  • Memcached::set — Store an item
  • Memcached::setByKey — Store an item on a specific server
  • Memcached::setEncodingKey — Set AES encryption key for data in Memcached
  • Memcached::setMulti — Store multiple items
  • Memcached::setMultiByKey — Store multiple items on a specific server
  • Memcached::setOption — Set a Memcached option
  • Memcached::setOptions — Set Memcached options
  • Memcached::setSaslAuthData — Set the credentials to use for authentication
  • Memcached::touch — Set a new expiration on an item
  • Memcached::touchByKey — Set a new expiration on an item on a specific server

클래스 참조

  • MemcachedException — The MemcachedException class

더 알아보기

  • addByKey, getByKey처럼 ByKey가 붙은 메서드는 특정 서버에 키를 직접 매핑해서 저장/조회해요. 분산 환경에서 키를 제어해야 할 때 유용해요.
  • 같은 캐시 데몬을 쓰더라도 Memcache(d 없는) 확장과는 별개의 확장이에요. 기능과 API가 다르니 목적에 맞게 선택하세요.