2. 분산시스템 기술
1. Resource Sharing
2. Transparency
Access: Hide differences in data representation and how a resource is accessed
Location: Hide where a resouce is located
Migration: Hid that a resource may move to another location
Relocation
Replication: Hide that a resource is replicated
Concurrency: Hide that a resource may be shraed by several competitive users
Failure: Hide the failure an recovery of a resource
Degree of Transparency
결론: 어느 정도만 추구하는 것이 좋다.
완벽하게 숨기는 것은 performance 측면에서 어렵기 때문
3. Scalability
확장성: 인터넷 환경
확장성의 세 가지 요소
Size scalability(규모 측면): 유저/프로세스의 수
Geographical scalability(지리적 측면): 노드 사이의 최대 거리
Administrative scalability(관리적 측면): 관리 도메인의 수
Techniques for Scaling
- Partition data/computation acroose multiple machines
- Java applets, DNS, WWW
- 복제와 캐싱 (Replication and caching): 데이터의 복제를 만들어 다른 머신에 저장한다.
- 하지만 복제본을 만들 경우 한 복제본이 변경되었을 때 다른 것도 동기화되어야함
DNS
hierarchically distributed
Application-layer protocol
Web
World Wide Web(WWW)
하나의 단독 서버에서 가져오는 것이 아니라 많은 서버로부터 가져온다.
Parallel computing
Parallel computing이 시작되면서 높은 성능의 분산 컴퓨팅이 가능해졌다.
Multiprocess / multicore | Multicomputer |
Shared memory | Private memory |
네트워크를 통해 하나의 메모리를 공유한다. | 각각의 개인 메모리를 가짐. |
SMP (Symmetric Multiprocessor) | Cloud (Distributed Systems) |
4. SMP : Symmetric Multiprocessor
- multi-core processor에서는 여러 개의 코어가 프로세스를 나누어 담당함.
- 프로세서와 캐시를 각자가 가지고 있지만 메모리와 I/O device는 네트워크를 통해 공유함
왜 멀티코어 프로세서인가?
Moore's law에 따르면 18-24개월 마다 트랜지스터의 수용량이 두 배가 된다고 하였지만, 실제로 이론상의 효율을 내려면 태양의 온도를 견딜 수 있는 CPU가 필요함. (그런거 없엄!!)
이것을 해결하게 위해
- Pipelining
- multi-core processor
- SMP, Shared memory
를 이용한다.
만일 어떤 x라는 값이 변경되었을 때 그 값이 캐시에만 갱신되고 공유하는 메모리에는 반영되지 않는다면, 또 다른 코어에서 그 x 값에 접근할 때 값이 일치하지 않는(incoherent) 문제가 발생한다.
write-through
cache의 값이 바뀌었을 때 cache뿐만 아니라 memory에서도 write 해주는 방법.
단점: 또 다른 core의 cache에 해당 값이 있을 경우 memory incoherent 발생
예시)
Time step | Event | Core A's cache | Core B's cache | Memory |
0 | 3 | |||
1 | Core A read X | 3 | 3 | |
2 | Core B read X | 3 | 3 | 3 |
3 | Core A write 0 to X | 0 | 3 | 0 |
Snoopy cache (Bus sniffing)
거의 모든 bus-based 구조에서 snoopy cache를 사용한다.
값을 write 할 때 invalidate message를 bus를 통해 모든 캐시/메모리에 전송한다(broadcast). 만일 다른 캐시/메모리에 그 값이 있으면 지운다. 또 다른 캐시가 그 값을 읽으려고 할 때는 cache miss가 발생한다.
예시)
CPU activity | Bus activity | Core A's cache | Core B's cache | Memory |
0 | ||||
Core A reads X | Cache miss for X | 0 | 0 | |
Core B read X |
Cache miss for X | 0 | 0 | 0 |
Core A writes 1 to X | Invalidate for X | 1 | (deleted) | 0 |
Core B read X | Cache miss for X | 1 | 1 | 1 |
Problem
Bus-based mulitcomputer
- 메모리를 공유 문제
- memory coherence problem
- 트래픽 증가
- 기존의 문제점을 극복해보자.
- 통신에는 버스(bus) 가 필요하다.
- 메모리 접근보다 트래픽이 낮으면 좋겠다.
- 물리적인 버스 보다는 LAN(local area network)를 사용해보자.
- 멀티 코어만 가지고 안된다면 컴퓨터를 여러 대로 늘려서 한계를 극복하자.
Switched multicomputer on LAN
- 네트워크 상에서 send/receive message를 통해 프로세서 사이에서 메세지를 주고받자.
- 즉 각각의 컴퓨터는 독립적인 프로세서, 캐시, 메모리 가지며 이들 사이의 통신은 네트워크를 이용한다.
5. Distributed Systems
- Cloud data center
- 구글, 페이스북, 아마존...
- Cluster Computing: 10000개 이상의 저렴한 기계를 사용해 큰 문제를 해결한다
- Devide and Conquer - Map & Reduce
- Distributed File System - Hadoop File System (HDFS)
Distributed Computing
Distributed Computing system
높은 컴퓨팅 성능을 위해 사용된다
슈퍼 컴퓨터 -> 클러스터 컴퓨팅 시스템, Grid 컴퓨팅 시스템
지금은 하나의 문제를 여러 개의 서브 문제로 만들고 각각의 컴퓨터가 해결한다. (Devide and Conquer)
큰 하나의 문제/데이터를 해결하는 것은 많은 작은 문제/데이터를 해결하는 것과 같다.
기타
Distributed Home systems (networks) : 개인 디바이스, 엔터테인먼트, 핸드폰, Network attached storage(NAS) 는 게이트 웨이를 거친다. 이때, self-configuring, sharing policy 가 이슈임.
Distributed Electronic Health Care Systems
Internet of Things (IoT)
Connected Cars->Automated Vehicles
요약
1. 분산 시스템은 자율적인(autonomous) 여러 대의 컴퓨터로 이루져있고 그 컴퓨터들이 같이 일하면서 하나의 시스템으로 보이는 것이다. (single coherent system)
2. 특징: Sharing, Transparend, Scalable
3. Parallel Computing: SMP, Cloud
4. 분산시스템의 다른 종류: Home network, Healthcare systems, IoT, Automated Cars..
Subscribe to Mem Learning
Get the latest posts delivered right to your inbox