> For the complete documentation index, see [llms.txt](https://zisoft-awareness.gitbook.io/fawry-cloud-devops-internship/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zisoft-awareness.gitbook.io/fawry-cloud-devops-internship/master/sema-application-sizing-estimation-process-..md).

# SeMA application sizing-estimation process .

Shown below is a diagram of  sizing-estimation process. It is not the only method for sizing deployment, but it should provide useful insight and guidance

![](https://365629076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ltmq2JraOA1rcy1fWoI%2Fuploads%2FTNZiOPI4Mo5CpSxzIRqr%2Fimage.png?alt=media\&token=da2ad87f-7d8d-4ec9-b6c6-9828170e58b1)

\
**1. Estimate user concurrency and throughput**

In most use-case scenarios, the number of expected concurrent users is far less than the number of named users of  system. A scenario in which all of the named users are simultaneously accessing the system is extremely rare. Normally, a globally distributed organization with users spread out all over the world experience about ⅓ of its named users online at any time during their individual 8-hour work days.

Concurrency typically ranges from 10% to 50+% for App deployments.

| 10 % \[ Minimum  ]        | 5000 | 500  |
| ------------------------- | ---- | ---- |
| 20 % \[ Average ]         | 5000 | 1000 |
| 30 % \[ Recommended ]     | 5000 | 1500 |
| 40 % \[ Highly  Scaled  ] | 5000 | 2500 |

&#x20;

**2. Estimate SeMA Application  HW sizing** <br>

{% hint style="success" %}
A- Every CPU core handles 2 Worker \
B- Worker can handle 5 System Users or 20 Portal users\
C- Concurrent user = Users use app simultaneously with time session 5 sec\
D - Best practice of workers per machine from 17 to 33 \[Due to processor queuing]
{% endhint %}

```
Number of portal Users [5000]
Number of concurrent users =  40 * 5000 / 100 = 2000 
× Number of Woker = 2000 / 20 = 100 Woker 
x Number of Workers / VM = 33
x Number of Core / VM = 16 core 
x RAM cacpity estimation [ 1 core * 4 ] = 16 * 4 = 64 Gb / VM

Minimum 4 VM with 16 core / 64 Gb RAM
Recommended 5 VM x with 16 core / 64 Gb RAM
 
```

**3. Estimate SeMA DB  HW sizing** \
\
Database storage requirements may be estimated roughly using the following calculation:<br>

{% hint style="success" %}

```
Number of Users [ 5000 ]
× Number of events per host per day [ 15 ]
× 5Kb per event

Number of Users × Number of events per host per day
× 5Kb per event

For example, an organization of 5,000 Users, with each user generating 
an average of 15 events per day, 
requiring a 30 day retention would require a database capacity of:

```

{% endhint %}

```markup
## DB stoage sizing / Month
      5,000 × 15 × 5 × 30 = 11,250,000Kb, or 11Gb

## DB stoage sizing / Year
      11 GB per Month x 12 = 132 Gb / Year

DB HW sizing for 5000 client connections / sec

# DB Version: 14
# OS Type: linux
# DB Type: web
# Total Memory (RAM): 96 GB
# CPUs num: 24
# Connections num: 5000
# Data Storage: san

max_connections = 5000
shared_buffers = 24GB
effective_cache_size = 72GB
maintenance_work_mem = 2GB
checkpoint_completion_target = 0.9
wal_buffers = 16MB
default_statistics_target = 100
random_page_cost = 1.1
effective_io_concurrency = 300
work_mem = 1258kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 24
max_parallel_workers_per_gather = 4
max_parallel_workers = 24
max_parallel_maintenance_workers = 4
```

**4. Estimate SeMA File Storage  HW sizing**

```
x Number of users  [ 5000 ]
× Number of survey per user  per day  [ 2 ]
× 25 Mb per survey attachment  [ 25 mb ]
Number of Users × Number of survey per user  per day
× 25 Mb per survey attachment

## File storage sizing / Month

      5,000 × 2 x 25 Mb × 30 = 750 Gb

## File storage sizing / Year
 
      750 GB per Month x 12 = 9 TB  / Year


```

{% hint style="info" %}

#### SeMA App file storage can start with 4 TB and extend based on monitoring actual usage of storage

{% endhint %}

<br>
