Skip to content

Commit

Permalink
CHG - increase CPUs limits for all apps
Browse files Browse the repository at this point in the history
  • Loading branch information
MRColorR committed Feb 8, 2024
1 parent 7662251 commit dc9f47b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions runme.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ function adaptLimits {
$TOTAL_CPUS = (Get-WmiObject -Class Win32_Processor | Measure-Object -Property NumberOfCores -Sum).Sum

# Adapt the limits in .env file for CPU and RAM taking into account the number of CPU cores the machine has and the amount of RAM the machine has
# CPU limits: little should use max 15% of the CPU power , medium should use max 30% of the CPU power , big should use max 50% of the CPU power , huge should use max 100% of the CPU power
$appCpuLimitLittle = ($TOTAL_CPUS * 15 / 100)
$appCpuLimitMedium = ($TOTAL_CPUS * 30 / 100)
$appCpuLimitBig = ($TOTAL_CPUS * 50 / 100)
# CPU limits: little should use max 25% of the CPU power , medium should use max 50% of the CPU power , big should use max 75% of the CPU power , huge should use max 100% of the CPU power
$appCpuLimitLittle = ($TOTAL_CPUS * 25 / 100)
$appCpuLimitMedium = ($TOTAL_CPUS * 50 / 100)
$appCpuLimitBig = ($TOTAL_CPUS * 75 / 100)
$appCpuLimitHuge = ($TOTAL_CPUS * 100 / 100)

# Ensure CPU limits are not below minimum
Expand Down
8 changes: 4 additions & 4 deletions runme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ fn_adaptLimits() {
TOTAL_CPUS=$(lscpu -b -p=Core,Socket | grep -v '^#' | sort -u | wc -l)

# Adapt the limits in .env file for CPU and RAM taking into account the number of CPU cores the machine has and the amount of RAM the machine has
# CPU limits: little should use max 15% of the CPU power , medium should use max 30% of the CPU power , big should use max 50% of the CPU power , huge should use max 100% of the CPU power
# CPU limits: little should use max 25% of the CPU power , medium should use max 50% of the CPU power , big should use max 75% of the CPU power , huge should use max 100% of the CPU power
if command -v awk &> /dev/null; then
local APP_CPU_LIMIT_LITTLE=$(awk "BEGIN {print $TOTAL_CPUS * 15 / 100}")
local APP_CPU_LIMIT_MEDIUM=$(awk "BEGIN {print $TOTAL_CPUS * 30 / 100}")
local APP_CPU_LIMIT_BIG=$(awk "BEGIN {print $TOTAL_CPUS * 50 / 100}")
local APP_CPU_LIMIT_LITTLE=$(awk "BEGIN {print $TOTAL_CPUS * 25 / 100}")
local APP_CPU_LIMIT_MEDIUM=$(awk "BEGIN {print $TOTAL_CPUS * 50 / 100}")
local APP_CPU_LIMIT_BIG=$(awk "BEGIN {print $TOTAL_CPUS * 75 / 100}")
local APP_CPU_LIMIT_HUGE=$(awk "BEGIN {print $TOTAL_CPUS * 100 / 100}")
else
local APP_CPU_LIMIT_LITTLE=$(( TOTAL_CPUS * 15 / 100 ))
Expand Down

0 comments on commit dc9f47b

Please sign in to comment.