Ace-T's Blog 내 검색 [네이버 커넥트 이웃 합니다~^-^/ 요청 大 환영~~]

redis 메모리 사용량?

OpenSource/Redis 2016.01.27 11:17
[Good Comment!!, Good Discussion!!, Good Contens!!]
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T

http://redis.io/topics/quickstart


redis 관련 정보를 얻을 수 있다.


특히 redis-cli (commad line)을 통해 redis에서 사용하고 있는 용량을 알수 있다.

redis-cli info를 하면 아래와 같은 내용이 나오며 실제 사용되어지고 있는 것은 used_memory_human를 보면 된다.

# Memory
used_memory:38894386256
used_memory_human:36.22G
used_memory_rss:46722285568
used_memory_peak:85900378992
used_memory_peak_human:80.00G
used_memory_lua:31744
mem_fragmentation_ratio:1.20

mem_allocator:jemalloc-3.2.0


리눅스 메모리 사용률도 함께 체크하면 좋다.

참고  http://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%EB%A9%94%EB%AA%A8%EB%A6%AC_%EC%82%AC%EC%9A%A9%EB%A5%A0_%ED%99%95%EC%9D%B8




'OpenSource > Redis' 카테고리의 다른 글

redis 메모리 사용량?  (0) 2016.01.27

acet 박태하가 추천하는 readtrend 추천글!

설정

트랙백

댓글

:::: facebook을 이용하시는 분들은 로그인 후 아래에 코멘트를 남겨주세요 ::::

Redis 사용하기

BigDATA 2014.11.10 18:55
[Good Comment!!, Good Discussion!!, Good Contens!!]
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T



Redis 자바 연동

  ㄴ jedis라는 라이브러리가 있음. 


Maven을 사용한다면! 참고

더보기


 

Jedis api : http://javadox.com/redis.clients/jedis/2.6.0/redis/clients/jedis/Jedis.html


몇몇을 살펴보자! ^-^

select

public String select(int index)
Select the DB with having the specified zero-based numeric index. For default every new client connection is automatically selected to DB 0.

Specified by:
select in interface BasicCommands
Parameters:
index -
Returns:
Status code reply

randomKey

public String randomKey()
Return a randomly selected key from the currently selected DB.

Time complexity: O(1)

Specified by:
randomKey in interface MultiKeyCommands
Returns:
Singe line reply, specifically the randomly selected key or an empty string is the database is empty

lrange

public List<String> lrange(String key,                           long start,                           long end)
Return the specified elements of the list stored at the specified key. Start and end are zero-based indexes. 0 is the first element of the list (the list head), 1 the next element and so on.

For example LRANGE foobar 0 2 will return the first three elements of the list.

start and end can also be negative numbers indicating offsets from the end of the list. For example -1 is the last element of the list, -2 the penultimate element and so on.

Consistency with range functions in various programming languages

Note that if you have a list of numbers from 0 to 100, LRANGE 0 10 will return 11 elements, that is, rightmost item is included. This may or may not be consistent with behavior of range-related functions in your programming language of choice (think Ruby's Range.new, Array#slice or Python's range() function).

LRANGE behavior is consistent with one of Tcl.

Out-of-range indexes

Indexes out of range will not produce an error: if start is over the end of the list, or start > end, an empty list is returned. If end is over the end of the list Redis will threat it just like the last element of the list.

Time complexity: O(start+n) (with n being the length of the range and start being the start offset)

Specified by:
lrange in interface JedisCommands
Parameters:
key -
start -
end -
Returns:
Multi bulk reply, specifically a list of elements in the specified range.

hget

public String hget(String key,                   String field)
If key holds a hash, retrieve the value associated to the specified field.

If the field is not found or the key does not exist, a special 'nil' value is returned.

Time complexity: O(1)

Specified by:
hget in interface JedisCommands
Parameters:
key -
field -
Returns:
Bulk reply

hkeys

public Set<String> hkeys(String key)
Return all the fields in a hash.

Time complexity: O(N), where N is the total number of entries

Specified by:
hkeys in interface JedisCommands
Parameters:
key -
Returns:
All the fields names contained into a hash.


위의 명령어들은 실제 Server로 가서 redis-cli를 통해서 수행할 수 있다.
select 0 등으로  DB를 선택하여 주고 
randomkey를 통해 랜덤하게 키를 뽑아낼 수 있다.
또한 hget이나 lrange를 통해서 값을 뽑아낼수 있다.

 - 끝~ - 


'BigDATA' 카테고리의 다른 글

층화추출법  (0) 2014.11.26
Redis 사용하기  (0) 2014.11.10

acet 박태하가 추천하는 readtrend 추천글!

설정

트랙백

댓글

:::: facebook을 이용하시는 분들은 로그인 후 아래에 코멘트를 남겨주세요 ::::

티스토리 툴바