Skip to content

Commit a89688c

Browse files
authored
[readme] Finalizing the readme
- Add a general description - Described requirements, compilation, and usage. - Described implemented versions - Described performance tests - Add the performance tests data visualizations
1 parent 7a817c5 commit a89688c

File tree

1 file changed

+116
-29
lines changed

1 file changed

+116
-29
lines changed

readme.md

Lines changed: 116 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,134 @@
22

33
Author: [Yuriy Pasichnyk](https://github.com/Fenix-125)<br>
44

5+
This repository is a part of a bachelor's thesis.
6+
7+
Thesis title: **Performance analysis of synchronous and asynchronous parallel network server implementations using the C++ language**
8+
9+
510
## Description
611

7-
<mark>TODO</mark>
12+
The main two paradigms for implementing parallel network servers are synchronous and asynchronous. After an overview of these methodologies and implementation choices, the most representative and valuable versions of a **stateful TCP echo server** were designed and implemented. The versions and their specification are listed below:
13+
14+
- **echo_server_simple_threaded** -- synchronous multithreaded
15+
* A separate thread per client is used.
16+
* A blocking I/O is used.
17+
- **echo_server_simple** -- hybrid-synchronous single-threaded
18+
* The hybrid keyword is used to denote that an asynchronous syscall("poll syscall") is used.
19+
* A blocking I/O is used.
20+
- **echo_server_custom_thread_pool** -- hybrid-synchronous multithreaded
21+
* The hybrid keyword is used to denote that an asynchronous syscall("poll syscall") is used.
22+
* Custom thread pool is used to distribute work between worker threads.
23+
* A blocking I/O is used.
24+
- **echo_server_boost_asio** -- asynchronous single-threaded
25+
* For this implementation, the boost asynchronous lib was used.
26+
* A non-blocking I/O is used.
27+
- **echo_server_boost_asio_threaded** -- asynchronous multithreaded
28+
* For this implementation, the boost asynchronous lib was used, too.
29+
* A non-blocking I/O is used.
30+
31+
All versions support **Google Logging**. The Logging in the not-debug compilation is reduced due to performance concerns.
32+
The logging output is written to separate files in the newly created **./logs** directory.
33+
34+
### Server Requirements
35+
36+
- Send back received data from the client
37+
- Hold the client session until the client terminates it
38+
- Use TCP as the transport level protocol
39+
840

941
## Prerequisites
1042

11-
<mark>TODO</mark>
12-
<!--
13-
<mark>LIST LIBRARIES/TOOLS/OTHER UTILITIES THAT NEED TO BE INSTALLED (E.G. GCC, OPENMP, CMAKE ETC)</mark>
14-
-->
43+
The requirements for **apt** and **apk** Linux packet managers are listed in the corresponding files in the **dependencies** directory.
44+
An example how to install dependencies you can find below:
45+
46+
```{bash}
47+
$ apt update && apt upgrade
48+
$ xargs apt install -y << ./dependencies/apt.txt
49+
```
50+
51+
## Compilation
52+
53+
The compilation is automated using the **compile.sh**. Please refer to the help of the script via the **-h** option.
54+
To compile all the versions with optimization and install them to the **./bin** directory (created automatically), use the command below:
55+
56+
```{bash}
57+
$ bash ./compile.sh
58+
```
59+
60+
## Usage
61+
62+
The compiled executables can be run in normal user mode as shown below for differnt versions:
63+
64+
```{bash}
65+
$ ./echo_server_simple_threaded
66+
$ ./echo_server_simple
67+
$ ./echo_server_custom_thread_pool
68+
$ ./echo_server_boost_asio
69+
$ ./echo_server_boost_asio_threaded
70+
```
71+
72+
## Testing description
73+
74+
The perfomance testing of this versions is done using the [Fortio](https://github.com/fortio/fortio) opern source testing tool with parameters listed below:
75+
76+
- **"-qps 0"** -- try to send maximum number of queries per second
77+
- **"-t 60 s"** -- test duration 60 seconds
78+
- **"-c <client-num>"** -- client number parameter
79+
- **"-payload-size 64"** -- set the client message size
80+
- **"-uniform"** -- de-synchronize parallel clients’ requests uniformly
1581

16-
### Compilation
82+
The server was run on a PC with characteristics listed below:
83+
84+
| Characteristic | Value |
85+
|----------------|-------|
86+
|CPU Architecture| x86_64|
87+
|CPU Model name | 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz|
88+
|Logical CPUs | 8 |
89+
|Physical CPUs | 4 |
90+
|CPU max MHz | 4200 |
91+
|CPU min MHz | 400 |
92+
|CPU Byte Oserver| Little Endian |
93+
|L1d cache | 192 KiB (4 instances)|
94+
|L1i cache | 128 KiB (4 instances)|
95+
|L2 cache | 5 MiB (4 instances) |
96+
|L3 cache | 8 MiB (1 instance) |
97+
|RAM | 12.0 GB |
98+
|RAM type | DDR4 SDRAM |
99+
| OS | Ubuntu 20.04 LTS |
100+
| OS Kernel | Linux Kernel 5.4 |
101+
| NIC | Gigabit Ethernet LAN |
102+
103+
The load for the server was generated from 3 PCs, which were interconnected with a Gigabit Ethernet network using a Cisco Switch.
104+
The metrics that we used to measure the performance are:
17105

18-
<mark>TODO</mark>
19-
<!--
20-
<mark>HOW TO COMPILE YOUR PROGRAM? (RECOMMENDED: ./comile.sh)</mark>
21-
-->
106+
- Connected clients number
107+
- Throughput
108+
- Latency
109+
- CPU consumption
110+
- Memory consumption
22111

23-
### Installation
112+
## Performance Visualizations
24113

25-
<mark>TODO</mark>
26-
<!--
27-
<mark>DESCRIBE THE INSTALLATION PROCESS (USE ./dependencies FOLDER)</mark>
28-
<mark>Note: For Python scripts, You must add `requirenments.txt`
114+
Below you can see visualizations of data collected from the Fortio load tests.
29115

30-
file and add your env to the `.gitignore` file!</mark>
31-
-->
116+
### Throughput in respect to clients number
117+
![chart-throughput-1](https://user-images.githubusercontent.com/44115554/174493902-5a443db8-d388-4cb6-a8c6-ce589cf2a761.png)
32118

33-
### Usage
119+
### Average latency in respect to clients number
120+
![chart-avg-latency-1](https://user-images.githubusercontent.com/44115554/174493923-57d92a2c-208e-4d07-ac15-c45740871067.png)
34121

35-
<mark>TODO</mark>
36-
<!--
37-
<mark>PROVIDE AN EXAMPLE OF HOW TO RUN YOUR PROGRAM (IT CAN BE A_flag COMMAND LINE WITH INPUT AND EXPECTED OUTPUT)</mark>
122+
### 90 percentile latency in respect to clients number
123+
![chart-latency-persentile-90-1](https://user-images.githubusercontent.com/44115554/174493951-23898f1b-536d-4f7d-bf7a-9d6e254199d0.png)
38124

39-
<mark>Note: if your project needs or generates any data, media and so on -- put them
40-
into the data folder</mark>
41-
-->
125+
### 99 percentile latency in respect to clients number
126+
![chart-latency-persentile-99-1](https://user-images.githubusercontent.com/44115554/174493947-d4dfbf48-7524-4aec-9c6d-a471fd1159d1.png)
127+
128+
### 99.9 percentile latency in respect to clients number
129+
![chart-latency-persentile-999-1](https://user-images.githubusercontent.com/44115554/174493954-b26e2221-c3ca-4e82-8f15-374c01f509cb.png)
42130

43-
### Results
131+
### CPU usage in respect to clients number
132+
![chart-cpu-1](https://user-images.githubusercontent.com/44115554/174493984-806543e4-73eb-4938-9623-08e9dd1c6a68.png)
44133

45-
<mark>TODO</mark>
46-
<!--
47-
<mark>DESCRIBE THE RESULTS OF THE WORK YOU DID. WHAT DID YOU LEARN OR FIND INTERESTING?</mark>
48-
-->
134+
### Memory usage in respect to clients number
135+
![chart-mem-1](https://user-images.githubusercontent.com/44115554/174493981-ebd5d198-09f8-4e67-a6eb-0a2a472d3cf3.png)

0 commit comments

Comments
 (0)