# Lab 7
For this lab I decided to use **3 years** (36 months) for period, since this is the most appropriate way to evaluate two different approaches (and also the most profitable if you look at aws) - $M$
## Owning
+ 1 Server costs about $1,000: [link](https://www.newegg.com/p/1VK-0003-1HN53?Description=8%20core%2032%20gb&cm_re=8_core%2032%20gb-_-1VK-0003-1HN53-_-Product) - $S$
+ 4 TB of HHD disk costs $350: [link](https://www.newegg.com/western-digital-blue-4tb/p/N82E16820250121) - $D$
+ Accorrding to [this site](https://news.energysage.com/how-many-watts-does-a-computer-use/#:~:text=Using%20a%20computer%20for%208,to%20use%20for%20a%20year.) and [this site](https://www.servermania.com/kb/articles/how-much-does-a-server-cost-for-a-small-business/) average cost for electricity for 1 compuer is about $30 - $E$
+ Let's take systems administrator's salary at $3,000 per month (as was written in lab) - $SAS$
+ Also you need place where the servers will be located, let's take $1000 per month for simplicity, I don't know how to search this pricing - $P$
+ There could be some unforeseen expenses, let's assume about $500 per month - $UE$
+ For 64 servers you will need high-quality internet provider, let's take another $500 per month - $I$
Final formula (in USD):
$$ f(M) = 64 \cdot (S + D) + M \cdot (SAS + 64 \cdot E + P + UE + I)$$
$$ f(M) = 64 \cdot (1000 + 350) + M \cdot (3000 + 64 \cdot 30 + 1000 + 500 + 500)$$
$$ f(M) = 86400 + M \cdot 6920$$
$$ total\text{_}own = f(36) = 335520$$
## Cloud
### AWS
> used https://calculator.aws
> Result: https://calculator.aws/#/estimate?id=35c724937850120ca56a847a4dff3fbaf7d078fa
+ For I decided to use `t4g.2xlarge` instance instead of `m4.x2large` as was mentioned in lab, since it also has 8 CPU and 32 GB but it has older and therefore cheaper hardware.
+ For payment policy I decided to pay **max upfront** and take **3 years** of reservation since this is the most profitable option.
#### Servers config:

#### S3 config:

#### Summary

So, for 3 years we get
$$total\text{_}aws = 12167 \cdot M + 186020 = 624032$$
### Yandex Cloud
> used https://cloud.yandex.com/en/prices
> Result: https://cloud.yandex.com/prices?state=59d8084f39e9#calculator
#### Servers config

#### S3

#### Summary

So, for 3 years we get
$$ total\text{_}yc = 11172 \cdot M = 402192$$
## Results
| | Owning | AWS | Yacloud |
|:------------------------ | ------ | ------- |:-------:|
| Total, for 3 years (USD) | 335520 | 624032 | 402192 |
| Total / 36 (USD) | 9320.0 | 17334.2 | 11172 |