This document discusses PlanDas Cache Cloud, a caching solution. It begins by covering concepts like availability, performance, reliability, and manageability as they relate to caching. It then discusses the differences between distributed and global caching approaches. The document outlines how caching can improve performance for web services and help address bottlenecks. It introduces the PlanDas Cache Cloud architecture, which uses consistent hashing for high availability. The document shows how the solution provides a global cache, multi-tenancy, and high performance. It also covers the web management interface and similarities to Redis APIs. Finally, it shares performance test results on AWS and physical machines that show throughput scaling as nodes are added.
9. Disk vs. SSD vs. Memory
From “Scalable Web Architecture And Distributed Systems”
From The Pathologies of Big Data : reference site
Cache : Distributed vs. Global
11. Cache for performance
local cache Nodes with local cache
From “Scalable Web Architecture And Distributed Systems”
Cache : Distributed vs. Global
12. Cache Distributed vs. Global
Distributed cache Global cache
From “Scalable Web Architecture And Distributed Systems”
Cache : Distributed vs. Global
13. Distributed cache features
• Not be same data that
request nodes have.
• Between request nodes
communicate cached
data. And then data is
same.
• The more the number of
nodes is increased traffic.
Distributed Cache
From “Scalable Web Architecture And Distributed Systems”
Cache : Distributed vs. Global
14. Global cache Features
• All request nodes have
same cached data.
• Between request nodes do
not communicate cached
data.
Global Cache
From “Scalable Web Architecture And Distributed Systems”
Cache : Distributed vs. Global
15. Global Cache
Responsible global cache Simple global cache
From “Scalable Web Architecture And Distributed Systems”
1. For each request, the Request Node will
check the global cache first.
2. If the data was not in the cache, the cache
will pull the data from the origin, and then
add the result to the cache for future
requests by the Global Cache.
1. For each request, the Request Node will
check the global cache first.
2. If the data was not in the cache then the
Request Node will retrieve it from the
origin.
3. When data is retrieved from the origin, it
can be added to the cache by the Request
node.
Cache : Distributed vs. Global
24. Plandas Cache Cloud
1. Plandas Architecture
2. HA: Auto Fail-Over (Client/Server)
3. Web (Admin) Management
4. If you want, support immediately
5. Similar to Redis API
41. Plandasj API
Category Methods
Keys exists,persist,type,ttl,del, etc.
Strings set,get,setbit,getbit,decrBy,incrBy, etc.
Hashes hset,hget,hmset,hmset,hincrBy,hdel, etc.
Lists rpush,lpush,llen,lrem,lpop,rpop, etc.
Sets sadd,spop,smembers, etc.
SortedSets Zadd, zcard, zcount, zincrby, zrange, zrangeByScore , etc.
But Not Support aggregation methods and the method that has gt 2 keys.
Ex) Sets’s sinter, sinterstore, sunion….
43. Test environment on AWS
• Test tool : ngrinder 3.1
• agent vm spec : 10ea (m1.large)
• Cache Cloud (node 개수가 많을수록 tps 는 증가함)
• vm spec : 3ea
• nodes per vm : 2ea
• total nodes : 6ea
51. NEXT
• Support all most languages (Proxy Server) : Completed
• Multi-IDC: Completed
• Spatial / Data Store Cloud
• from Cache to Data Store
52. I skate to where the puck is going to be,
not where it has been.
웨인 그레츠키(NFL)
Notas del editor
Plandas / Cache Cloud
시작. Concept
Cache 구성 모델.
서비스상의 Cache
Plandas
Concept 에서 출발한 처음 목표는 Cache 입니다.
Cache 관한 내용.
일반적인 Web Service Architecture.
Data -> Database, No-SQL, remote resource.
사용자는 원하는 특정 정보를 일반적으로 화면에 보여주길 원한다.
일반적으로 DBMS에 데이타를 저장하고 조회하는 구조.
결국 DBMS의 성능이 전체 시스템에 성능을 좌우하게 된다.
데이타의 저장위치에 따라 Random / Sequential Access 를 기준으로
성능을 보여주는 그림입니다. 상대적 비교를 보시면 …
Random : 1 vs 6 vs 12만.
Sequential : 1.2 vs 1 vs 8.5
사용자는 원하는 특정 정보를 일반적으로 화면에 보여주길 원한다.
일반적으로 DBMS에 데이타를 저장하고 조회하는 구조.
결국 DBMS의 성능이 전체 시스템에 성능을 좌우하게 된다.
데이타를 메모리에 가지고 있는 가격대 성능으로 보면 미리 가지고 있는 것.
App Server의 메모리에 미리 가지고 있으면 데이타 조회를 위해 먼길을 갈 필요가 없습니다.
미리 데이타를 가지고 있는 시스템 구조상의 패턴은 두가지로 나눌 수 있음.
앞의 App server가 가지고 있는 방법. 또는 별도로 저장소를 곧 메모리 저장소에 넣어두는 방법.
App Server에서 Cache 하는 구조의 가장 문제는
App server가 Round Robin 으로 Stateless하게 수행을 한다는 것
따라서 노드사이의 데이타가 동일해야 함으로 서로 데이타를 주고 받는 비용이 발생.
Global cache 는 네트워크 비용은 발생하지만 데이타를 한곳에 Cache 함.
설계시 네트워크 비용을 감안하여 설계한다면 Best 솔루션이 된.
가장 대표적으로 Session 을 저장하는 모델.
단점은 Cache 되는 데이타를 넣고 빼는 부분에 신경을 써야한다.
좀더 Global Cache 모델을 살펴보면.
Responsible 모델과 simple모델로 나눌수 있음.
Responsible : dbms’s buffer :result cache and web cache (squid , varnish)
Global : redis, memcached
그럼 앞에서 주구장창 말한 Cache는 어디에 사용할 수 있을까.
가장 떠오르는 모델은 DBMS의 성능을 향상시키는 모델.
보통 create, update, delete 와 read의 비율은 1:9 임.
Read의 성능을 개선하기 위해 DB를 튜닝하고 join을 효율화 하는 등.
DBMS의 성능은 기본적을 한계를 갖는다. 따라서 많은 비용을 소비하는 read를 효율화 해야한다.
Redis 모델은 Data Store 지원.
Plandas 의 구성으로 이루어지는 Redis 의 경운.
In memory key-value DataBase.
MQ상에서 pub/sub 모델에서 Message Queue 에서도 메세지를 저장할 때 DBMS를 사용한다.
동일한 성능 문제가 발생. Bottleneck 이 된다.
Cache 모델도 Data Store 모델로도 대치 가능하다.
그럼 끝나는게 아니고 다양한 서비스에서 동시 접근이 가능하게도 가능.
Cache 를 넘어가 Sharing. 더나아가 Data Store로도.
Plandas의 Goal은 Memory Data Store 임. 아직 좀 먼 이야기지만
먼저 Cache 에 중점을 두고 만듬.
Plandas에 대한 설명 순서.
Architecture
HA : 절대중요 Fail-Over
간단하게 관리.
즉시 서비스 사용가능
사용자 익숙성.
크게 3가지 layer.
중요핵심은 Library, Distributor
서비스 무장애 Lib, Coordinator, Distributor (Container), Storage.
Flow 로 살펴보면.
0 lookup dns .
1->2->3->4->5->6
분산 CS . Key hash function.
다음장.
Ketama consistent hashing ring
에서 virtual node 를 만개~수십만개 만들고
Key에 대해서 function 적용하여 분산.
심플하게는 mod 함수 생각.
다음HA.
Client Fail-Over 를 보면
Client 내에 Active Address 관리.
Threshold
Invalid address 제거, valid address 사용.
Cache Node는 저장되는 데이타를 분산하여 저장(continuum)
Hash function 에 의해 결정된다. (실제로는 p.m 에서 v.n 어려개..만개이상)
장비상의 장애 발생시 Fail-Over는 Client와 Server가 동시에 진행.
앞에 언급한 client fail-over. Server side fail-over.
간단하게 정리 Plandas는 재정리.
Cloud(?) 는 뒤에서 web service로 관리.
Admin 위한 configuration management
서비스 에게도 트래픽 모니터링을 제공.
통합 솔루션.
Web Admin 은 웹 서비스용이고
실제로는 management server 가 그 역할을 수행.
통계.
CSMap 관리를 통한 Cache node 관리.
Admin 에게 Container Server 정보를 조회 할 수 있도록함.
서비스 생성은
Admin에서 Service Code , 접근을 위한 auth code 를 만들고
Connect 할 cache node만 있으면 됨.
다음장은 Redis command 를 제공하는 API에 대해서.
Redis java client Jedis와
전용 Client Plandasj 를 비교하고 있음.
Connection , Trigger, Pub/sub, Server 은 지원안함.
또한 Aggregation func(union, intersection )
Jedis 와 거의 동일한 API를 제공함.
알파는 .. Redis의 다양한 언어 Client 를 제공하기 위한 다음 계획임.
그럼 성능은 어떨까요
AWS, Physical Machine (24 core, memory 32G)
Ngrinder 를 이용하여 진행함.
Scale up가능.
AWS 에서 Data 사이즈별 추이
AWS Instance의 시간별 편차가 있음을 유의해야 하며 AWS Instance 성능(VM) 에 영향받음.
Physical Machine 인 경우 2~4배정도 성능을 보이며 Network Latency 가 거의 발생하지 않아 영향이 없다.
TPS 맞은편 숫자는 ms 단위의 응답시간입니다. (mtt = 응답시간)
참고> 아래 그래프에서 vuser는 mtt가 짧은 경우 더 많은 tps 를 처리한다.
AWS 에서 Data 사이즈별 추이
AWS Instance의 시간별 편차가 있음을 유의해야 하며 AWS Instance 성능(VM) 에 영향받음.
Physical Machine 인 경우 2~4배정도 성능을 보이며 Network Latency 가 거의 발생하지 않아 영향이 없다.
TPS 맞은편 숫자는 ms 단위의 응답시간입니다. (mtt = 응답시간)
참고> 아래 그래프에서 vuser는 mtt가 짧은 경우 더 많은 tps 를 처리한다.
Nodes 가용량측정 : 일정한 리소스 투입으로 일정량의 가용성이 증가하는지 측정함.
기준되는 1 부하에 80 TPS(3.2ms)
1개 150 부하에 1만 2천 TPS , 3.6 ms 성능
2개 300 부하에 2만 2천 TPS , 6 ms 성능
3개 450 부하에 3만 2천 TPS , 8.3 ms 성능
한대의 세팅에서 2대이상으로 올라가는 경우 네트워크 비용이 발생한다.
AWS임을 고려하면 대략 2ms 정도가 응답시간에 영향을 주게 된다.
음. 장비증설이 가용량 증가분에 정비례하진? 않다? 는 결론이 나고 . 그 기울기는 ?
가용 용량을 공유하는 자원을 크게 가질수 있는 대신 네트웍 비용은 조금이나마 조금씩 증가하는 원리이다.
그럼 다음은 P.M
앞에서 AWS에서 테스트와 동일한 진행을.
결론적으로 기대TPS가 100% 만족되는 결과를 가져옴.
그래프화 해서 보면 .
왼쪽 수치는 TPS
오른쪽은 ms 단위의 응답시간입니다.
4k -10k 저장 값의 사이즈에 따른 성능을 한눈에 볼 수 있음.
보라색 점선은 1k 사이즈에 대한 평균치라고 보시면 됨.