intercity / intercity-next

Web control panel to deploy apps on your servers (with Dokku)
https://intercity.io/
MIT License
116 stars 23 forks source link

Have a more sane swap size on larger servers #249

Open michiels opened 5 years ago

michiels commented 5 years ago

Problem

We currently have the "Enable Swap" feature create a swapfile of current_swap * 3. For relatively small servers with 500M or 1G of memory this is quite sane, but for bigger servers it doesn't make to make the swap 3 times as large as the available memory.

For example: a 4GB server would end up with 12GB of swap. Maybe 1-2GB of swap on those servers is enough.

Suggestion

We can probably choose a maximum treshold for the multiplier. So that a server can never have more than 2G of swap. Or, we just always set it to 1GB, regardless of the system memory.