컴구 lecture note #02

2022. 9. 8. 22:58컴퓨터 구조

728x90

metrics : 측정항목

👋 Two metrics for defining computer performance (컴퓨터의 성능을 측정할 수 있는 척도)

1. Response time : 하나의 task를 수행하는데 걸리는 시간 (시작 ~ 끝)

The time between the start and completion of a task

ex. how long it takes to do a single task

 2. Throughput : 주어진 시간동안 얼마나 수행하는지

- throuput은 매우 중요한 측정항목임!! 특히 서버에서. 하지만 본 수업에서는 response time에 더 초점을 맞춤.

- A total amount of works done per unit time

ex. tasks per hour

클라이언트가 n개의 task를 처리해달라고 요청한 상황

1시간동안 이 서버는 k개까지 처리할 수 있다. k tasks per hour

 

Q1. 속도가 빠른 cpu로 교체했을 때 response time과 throughput은 각각 어떻게 변하겠는가?

 

response time 감소

throughput 증가

 

cpu속도가 빠르다 = 같은 task를 더 빠른 시간 안에 수행할 수 있다

 

Q2. CPU(processors)의 개수를 늘린다면?

response time 그대로

throughput 증가

 

cpu 개수를 늘린다 = 여러개의 task를 동시에 수행한다.

그러나 이것 역시 다르게 생각하면 우리가 하나의 큰 작업을 나눠서 처리할 수 있다면 response time 역시 줄어드게 될 것이다. 따라서 실제 컴퓨터 시스템에서는 1,2번의 경우 둘 다 성능을 향상할 것이다. (자세한 설명은 아래 그림 참고)

그림 1.6

 

 

👋 Performance의 정의  (response time과 관련해서 정의)

x컴퓨터가 y컴퓨터에 비해 N배 더 빠르다.
두컴퓨터의 preformanc 비교 (상대적인 performance)

  • Elapsed time = system performance = t1 + t2 + t3 + t4

The total time between the start and completion of a task, including everything

 

  • CPU time = CPU performance = t1 + t4 

The time spent processing a given task on a processor(CPU)

program1 이 CPU에 올라가있는 시간

 

* 본 수업에서는 CPU time에 초점을 맞춘다.

 

  • User CPU time

The CPU time spent for processing the code of the program

  • System CPU time

The CPU time spent in the operatiing system performing tasks for the program

 

 

Clock cycle(= tick, clock tick, ...)

 

cpu 성능의 기본단위

- A descrete time interval in which a CPU can perform a basic operation

- operation of digital hardware governed by a constant-rate clock

Clock frequency(=Clock rate) cycles per second 의미한다.
예를들어 4.0 GHz의 Clock rate를 갖는다면 이는 4000 MHz이며 4.0 * 10^9Hz이므로 4*10^9 cycle/sec을 갖는다.

 

Clock period Clock rate의 inverse한 개념이다. 1사이클의 주기를 의미한다.
1/clock rate로 계산할 수 있다. 4GHz는 250ps가 된다.

응답 시간과 CPU 시간

작업을 끝내는데 필요한 전체 응답 시간, 즉 경과 시간을 Elapsed Time이라 하는데, 이는 처리Processing, 입출력I/O, 운영체제 처리OS Overhead, 대기 시간Idle Time 등을 모두 합친 시간으로 매 실행마다 변화한다. 때문에 정확한 성능 측정을 위한 지표로 CPU 시간을 사용한다.

CPU 시간은 입출력 시간 등 다른 시간을 제외하고 오직 프로그램을 실행하기 위해 소비한 시간만을 의미한다.

'컴퓨터 구조' 카테고리의 다른 글

컴퓨터 구 lecture note #06  (0) 2022.10.09
컴퓨터 구조 lecture note #05  (0) 2022.10.06
컴구 Lecture Note #04  (1) 2022.10.02
컴구 lecture note #03  (0) 2022.09.18