사용자 도구

사이트 도구


memcached

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
마지막 판 양쪽 다음 판
memcached [2015/04/08 11:11]
kwon37xi
memcached [2018/06/27 06:56]
kwon37xi
줄 7: 줄 7:
   * [[https://code.google.com/p/memcached/wiki/NewCommands|Memcached Protocol Commands]]   * [[https://code.google.com/p/memcached/wiki/NewCommands|Memcached Protocol Commands]]
   * [[http://www.solanara.net/solanara/memcached|Memcached - 윈디하나의 솔라나라]]   * [[http://www.solanara.net/solanara/memcached|Memcached - 윈디하나의 솔라나라]]
 +  * [[http://helloworld.naver.com/helloworld/textyle/151047|hello world » Memcached의 확장성 개선]]
 +  * [[evcache|EVCache]]
  
 ===== 분산 캐시 사용시 주의점 ===== ===== 분산 캐시 사용시 주의점 =====
줄 12: 줄 14:
   * 분산 캐시는 내부 망에서의 부하를 유발한다. 대역폭 관리에 신경쓰지 않으면 사용자 폭증시에 웹서버와 DB와 캐시는 모두 CPU 점유율이 낮은데도 불구하고 내부망 대역폭 부족으로 느려지는 상태가 될 수 있다.   * 분산 캐시는 내부 망에서의 부하를 유발한다. 대역폭 관리에 신경쓰지 않으면 사용자 폭증시에 웹서버와 DB와 캐시는 모두 CPU 점유율이 낮은데도 불구하고 내부망 대역폭 부족으로 느려지는 상태가 될 수 있다.
  
 +===== 설치 =====
 +  * [[https://code.google.com/p/memcached/wiki/NewInstallFromSource|memcached install from source]]
 +<code sh>
 +./configure --prefix=/usr/local/memcached
 +make && make test
 +sudo make install
 +</code>
  
 ===== 설정 ===== ===== 설정 =====
줄 22: 줄 31:
 memcached -p 27012 -m 2048 -d -P /tmp/memcached.pid memcached -p 27012 -m 2048 -d -P /tmp/memcached.pid
 </code> </code>
 +  * ''-t [Core갯수]'' : 쓰레드 갯수를 지정한다. 기본값은 ''4''이며, 해당 장비의 CPU Core 갯수보다 같거나 작게 설정한다. CPU Core 수 보다 많으면 오히려 성능이 떨어진다.
 +
 +==== memcached 장시간 사용시 Wasted Memory 증가현상 ====
 +  * memcached를 장시간 사용하면서 키 사이즈가 달라질 경우, 기존 키 사이즈 slab이 할당받은 공간이 wasted 상태로 남고, 그 나머지만 신규 key 용으로 사용하게 되어 메모리 부족이 발생하게 되는 현상
 +  * ''-o slab_reassign slab_automove'' : memcached를 장시간 실행할 경우 slab page 재사용 - beta 기능. 
 +  * [[https://github.com/memcached/memcached/wiki/ReleaseNotes1411|Memcached Release Notes 1.4.11]]
 +  * [[http://balodeamit.blogspot.kr/2014/02/slab-reallocation-in-memcache.html|Slab Reallocation in Memcache - 자세한 설명]]
 +  * [[http://lks21c.blogspot.kr/2014/10/memcached-wasted-memory.html|크림슈가도넛의 Cookbooks: Memcached Wasted Memory 제거하는 법]]
 +
 +==== Linux Memory Swap 방지 ====
 +[[linux:performance|Linux Performance]]
 +<code sh>
 +$ sudo vi /etc/sysctl.conf
 +vm.swappiness = 0
 +  
 +$ sudo sysctl vm.swappiness=0
 +</code>
 +
 ===== Telnet 접속 ===== ===== Telnet 접속 =====
   * [[http://www.alphadevx.com/a/90-Accessing-Memcached-from-the-command-line|Accessing Memcached from the command line]]   * [[http://www.alphadevx.com/a/90-Accessing-Memcached-from-the-command-line|Accessing Memcached from the command line]]
줄 30: 줄 57:
   * [[http://neopythonic.blogspot.kr/2011/08/compare-and-set-in-memcache.html|Compare and set in memcached]]   * [[http://neopythonic.blogspot.kr/2011/08/compare-and-set-in-memcache.html|Compare and set in memcached]]
  
 +===== extstore - 외부 데이터 저장소 =====
 +  * [[https://memcached.org/blog/nvm-caching/|Caching beyond RAM: the case for NVMe]]
 +  * [[https://github.com/memcached/memcached/wiki/Extstore|Extstore · memcached/memcached Wiki]]
  
-===== Java 구현체 =====+ 
 +===== Java Client 구현체 =====
   * [[http://code.google.com/p/spymemcached/|spy memcached]]   * [[http://code.google.com/p/spymemcached/|spy memcached]]
   * [[http://code.google.com/p/xmemcached/|XMemcached]] - namespace 지원   * [[http://code.google.com/p/xmemcached/|XMemcached]] - namespace 지원
줄 71: 줄 102:
   * [[http://docs.libmemcached.org|libmemcached documentation]]   * [[http://docs.libmemcached.org|libmemcached documentation]]
   * [[http://docs.libmemcached.org/bin/memaslap.html|memaslap - Load testing and benchmarking a server]]   * [[http://docs.libmemcached.org/bin/memaslap.html|memaslap - Load testing and benchmarking a server]]
 +
 +===== 관리툴 =====
 +  * [[memcached:phpmemcachedadmin|PHP Memcached admin]]
 +  * [[memcached:django-memcache-admin|django-memcache-admin]]
 +
 +===== 참조 =====
 +  * [[http://dom.as/2008/12/25/memcached-for-small-objects/|Memcached for small objects]]
 +
memcached.txt · 마지막으로 수정됨: 2019/09/27 13:03 저자 kwon37xi