기본 콘텐츠로 건너뛰기

memcached 상태 정보(stats)


Memcached 설치 




* memcached stats 정보

memecached 상태를 보기위해 stats 명령어를 사용하는데,
option (settings, slabs, items) 별로 입력했을 때
나오는 결과값에 대한 설명.

https://github.com/memcached/memcached/blob/master/doc/protocol.txt

> stats
|-----------------------+---------+-------------------------------------------| | Name | Type | Meaning | |-----------------------+---------+-------------------------------------------| | pid | 32u | Process id of this server process | | uptime | 32u | Number of secs since the server started | | time | 32u | current UNIX time according to the server | | version | string | Version string of this server | | pointer_size | 32 | Default size of pointers on the host OS | | | | (generally 32 or 64) | | rusage_user | 32u.32u | Accumulated user time for this process | | | | (seconds:microseconds) | | rusage_system | 32u.32u | Accumulated system time for this process | | | | (seconds:microseconds) | | curr_items | 32u | Current number of items stored | | total_items | 32u | Total number of items stored since | | | | the server started | | bytes | 64u | Current number of bytes used | | | | to store items | | curr_connections | 32u | Number of open connections | | total_connections | 32u | Total number of connections opened since | | | | the server started running | | connection_structures | 32u | Number of connection structures allocated | | | | by the server | | reserved_fds | 32u | Number of misc fds used internally | | cmd_get | 64u | Cumulative number of retrieval reqs | | cmd_set | 64u | Cumulative number of storage reqs | | cmd_flush | 64u | Cumulative number of flush reqs | | cmd_touch | 64u | Cumulative number of touch reqs | | get_hits | 64u | Number of keys that have been requested | | | | and found present | | get_misses | 64u | Number of items that have been requested | | | | and not found | | delete_misses | 64u | Number of deletions reqs for missing keys | | delete_hits | 64u | Number of deletion reqs resulting in | | | | an item being removed. | | incr_misses | 64u | Number of incr reqs against missing keys. | | incr_hits | 64u | Number of successful incr reqs. | | decr_misses | 64u | Number of decr reqs against missing keys. | | decr_hits | 64u | Number of successful decr reqs. | | cas_misses | 64u | Number of CAS reqs against missing keys. | | cas_hits | 64u | Number of successful CAS reqs. | | cas_badval | 64u | Number of CAS reqs for which a key was | | | | found, but the CAS value did not match. | | touch_hits | 64u | Numer of keys that have been touched with | | | | a new expiration time | | touch_misses | 64u | Numer of items that have been touched and | | | | not found | | auth_cmds | 64u | Number of authentication commands | | | | handled, success or failure. | | auth_errors | 64u | Number of failed authentications. | | evictions | 64u | Number of valid items removed from cache | | | | to free memory for new items | | reclaimed | 64u | Number of times an entry was stored using | | | | memory from an expired entry | | bytes_read | 64u | Total number of bytes read by this server | | | | from network | | bytes_written | 64u | Total number of bytes sent by this server | | | | to network | | limit_maxbytes | 32u | Number of bytes this server is allowed to | | | | use for storage. | | threads | 32u | Number of worker threads requested. | | | | (see doc/threads.txt) | | conn_yields | 64u | Number of times any connection yielded to | | | | another due to hitting the -R limit. | | hash_power_level | 32u | Current size multiplier for hash table | | hash_bytes | 64u | Bytes currently used by hash tables | | hash_is_expanding | bool | Indicates if the hash table is being | | | | grown to a new size | | expired_unfetched | 64u | Items pulled from LRU that were never | | | | touched by get/incr/append/etc before | | | | expiring | | evicted_unfetched | 64u | Items evicted from LRU that were never | | | | touched by get/incr/append/etc. | | slab_reassign_running | bool | If a slab page is being moved | | slabs_moved | 64u | Total slab pages moved | |-----------------------+---------+-------------------------------------------|

> stat settings
|-------------------+----------+----------------------------------------------| | Name | Type | Meaning | |-------------------+----------+----------------------------------------------| | maxbytes | size_t | Maximum number of bytes allows in this cache | | maxconns | 32 | Maximum number of clients allowed. | | tcpport | 32 | TCP listen port. | | udpport | 32 | UDP listen port. | | inter | string | Listen interface. | | verbosity | 32 | 0 = none, 1 = some, 2 = lots | | oldest | 32u | Age of the oldest honored object. | | evictions | on/off | When off, LRU evictions are disabled. | | domain_socket | string | Path to the domain socket (if any). | | umask | 32 (oct) | umask for the creation of the domain socket. | | growth_factor | float | Chunk size growth factor. | | chunk_size | 32 | Minimum space allocated for key+value+flags. | | num_threads | 32 | Number of threads (including dispatch). | | stat_key_prefix | char | Stats prefix separator character. | | detail_enabled | bool | If yes, stats detail is enabled. | | reqs_per_event | 32 | Max num IO ops processed within an event. | | cas_enabled | bool | When no, CAS is not enabled for this server. | | tcp_backlog | 32 | TCP listen backlog. | | auth_enabled_sasl | yes/no | SASL auth requested and enabled. | | item_size_max | size_t | maximum item size | | maxconns_fast | bool | If fast disconnects are enabled | | hashpower_init | 32 | Starting size multiplier for hash table | | slab_reassign | bool | Whether slab page reassignment is allowed | | slab_automove | bool | Whether slab page automover is enabled | |-------------------+----------+----------------------------------------------|

> stats slabs
|-----------------+----------------------------------------------------------| | Name | Meaning | |-----------------+----------------------------------------------------------| | chunk_size | The amount of space each chunk uses. One item will use | | | one chunk of the appropriate size. | | chunks_per_page | How many chunks exist within one page. A page by | | | default is less than or equal to one megabyte in size. | | | Slabs are allocated by page, then broken into chunks. | | total_pages | Total number of pages allocated to the slab class. | | total_chunks | Total number of chunks allocated to the slab class. | | get_hits | Total number of get requests serviced by this class. | | cmd_set | Total number of set requests storing data in this class. | | delete_hits | Total number of successful deletes from this class. | | incr_hits | Total number of incrs modifying this class. | | decr_hits | Total number of decrs modifying this class. | | cas_hits | Total number of CAS commands modifying this class. | | cas_badval | Total number of CAS commands that failed to modify a | | | value due to a bad CAS id. | | touch_hits | Total number of touches serviced by this class. | | used_chunks | How many chunks have been allocated to items. | | free_chunks | Chunks not yet allocated to items, or freed via delete. | | free_chunks_end | Number of free chunks at the end of the last allocated | | | page. | | mem_requested | Number of bytes requested to be stored in this slab[*]. | | active_slabs | Total number of slab classes allocated. | | total_malloced | Total amount of memory allocated to slab pages. | |-----------------+----------------------------------------------------------|

> stats items
Name Meaning ------------------------------ number Number of items presently stored in this class. Expired items are not automatically excluded. age Age of the oldest item in the LRU. evicted Number of times an item had to be evicted from the LRU before it expired. evicted_nonzero Number of times an item which had an explicit expire time set had to be evicted from the LRU before it expired. evicted_time Seconds since the last access for the most recent item evicted from this class. Use this to judge how recently active your evicted data is. outofmemory Number of times the underlying slab class was unable to store a new item. This means you are running with -M or an eviction failed. tailrepairs Number of times we self-healed a slab with a refcount leak. If this counter is increasing a lot, please report your situation to the developers. reclaimed Number of times an entry was stored using memory from an expired entry. expired_unfetched Number of expired items reclaimed from the LRU which were never touched after being set. evicted_unfetched Number of valid items evicted from the LRU which were never touched after being set.


 * memcahed protocol

memcached 에서 get/set/delete 말고도 
명령어들이 은근히 있다. 

명령어에 대한 상세 설명은 memcacehd 위키에서. 
http://code.google.com/p/memcached/wiki/NewCommands




댓글

이 블로그의 인기 게시물

메일서버가 스팸으로 취급받을때

설치한 메일서버를 통해 발송되는 메일이 스팸으로 들어가는 경우가 더러 있다. 이게 한번 들어가기는 쉬운데, 빠져나오기는 드럽게 힘든것 같다... 본인의 경우에는 우선 국내서비스에는 별 무리 없이 들어간다. (naver,daum 등) 그런데 해외메일 그중 Gmail, Hotmail 에는 에누리없이 스팸으로 간주되고 있었다. Gmail같은 경우에는 그래도 스팸함으로 발송은 제대로 되는반면에 Hotmail같은경우에는 아예 수신자체가 안되는 경우도 더러있다.. ㅡ,.ㅡ; 제일 좋은 방법은 Gmail,Hotmail에 전화걸어서 우리 메일서버 IP white Ip로 등록해달라!!! 하면 좋지만, 얘네들은 걸어봤자 자동응답기고, 문의채널은 구글 그룹스 게시판이 전부다.. 본론으로 들어가서. 해외 메일이 차단될 경우 내 매일서버ip가 스팸ip로 등록되 버린 경우일 수 있다. (본인처럼. ㅎ) 이것부터 조회 해보고 싶으면 RBL(real-time blocking List) 체크를 해야 하는데, RBL체크 해주는 사이트는 꽤 많이 있고, 그중 좀 깔끔해 보이는곳 하나 소개. http://www.anti-abuse.org/ 메일서버ip 입력하고 조회해보면 쭈루룩 리스트가 나온다. 그 중 빨간불이 들어온 부분이 메일 서버가 스팸서버가 된 각종 이유들이다.ㅋ 본인의 경우 CBL 때문에 걸렸는데, 내용은 아래와 같다. This IP address is HELO'ing as  "localhost.localdomain"  which violates the relevant standards (specifically: RFC5321). 메일서버 도메인에 별다른 작업을 안해놓아서 "localhost.localdomain" 으로 설정되어있었다. 만약 CBL만 바로 테스트 해보고 싶으면 http://cbl.abusea

[javascript] 특정시간에만 함수 실행

특정시간에만 팝업을 띄우려면?? 특정시간에만 로그인을 막으려면?? 특정시간에만 할일은 의외로 참 많다. 방법? 딱히 없다. 현재시간 구해서 시작시간, 종료시간 사이에 있을때 시작하는 수밖엔. if ((현재시간 > 시작시간) && (현재시간 < 종료시간)){ .. 팝업노출(); 공사페이지 리다이렉트(); 기타등등(); .. } 자바스크립트로 작성하면 다음과 같다. var startdate = "2014012008" ; var enddate = "2014012418" ; var now = new Date (); //현재시간 year = now. getFullYear (); //현재시간 중 4자리 연도 month = now. getMonth () + 1 ; //현재시간 중 달. 달은 0부터 시작하기 때문에 +1 if ((month + "" ). length < 2 ){ month = "0" + month; //달의 숫자가 1자리면 앞에 0을 붙임. } date = now. getDate (); //현재 시간 중 날짜. if ((date + "" ). length < 2 ){ date = "0" + date; } hour = now. getHours (); //현재 시간 중 시간. if ((hour + "" ). length < 2 ){ hour = "0" + hour; } today = year + "" + month + "" + date + "" + hour; //오늘 날짜 완성. / / 시간비교 i

[linux] 모든 cron 확인

예전에 만들어놓은 cron이 요새 안돌고 있어서 찾아봤다. 물론 내가 만들었던 아니고ㅋ crontab -l no crontab for root 헐, 내가 찾던 cron이 안보인다. 분명히 예전 사수가 여기다 작업 해놓은것 같았는데... cron이 뭐하는 놈인지는 알아도, 어떻게 생겨먹은놈인지는 몰랐다ㅋ 이리저리 폴더 뒤져서 그때 스크립트 파일을 찾아보기 시작했다. 멍청한짓을 한 참 한후에 혹하는 마음에 로컬 사용자 뭐있나 찍어봄 cat /etc/passwd 찍어보믄 계정별로 결과가 쭈루루룩 나오는데, 뜻은 이거다. 계정:암호:UID:GID:정보:디렉토리:쉘 passwd 파일 설명은 ( http://www.linuweb.com/?p=248 ) 여기 님 블로그에 잘 되어있음. 암튼 결국 계정별로 cron 걸려있는거 죄다 찍어보니 for user in $(cut -f1 -d: /etc/passwd); do echo id $user; crontab -u $user -l ; done 한번에 다찍어주는 명령어는 따로 없나보다. 간단하게 스크립트로 찍어주는 수밖에. 결국 내가 찾던 cron은 처음보는 계정에 들어있었음. 그리고 cron이 안돌던 이유는 ftp가 막혀서였고 ㅋ