Add script max-memory-lx-container.sh - shows settings for LX Container configuration for memory limit.
This commit is contained in:
parent
204d008e76
commit
f2291aca69
20
max-memory-lx-container.sh
Executable file
20
max-memory-lx-container.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo ""
|
||||
echo -e " \033[32mTotal Memory:\033[23G\033[m$(free -b | grep -oP '\d+' | head -n 1) Byte"
|
||||
echo ""
|
||||
echo -e " \033[33mMax Memory LXC:\033[23G\033[m\033[1m$(( $(free -b | grep -oP '\d+' | head -n 1)-1000000000 ))\033[m Byte"
|
||||
echo ""
|
||||
|
||||
echo -e "
|
||||
In order to set max memory to your LX Container add the following
|
||||
line(s) to yor conatiner configuration:
|
||||
\033[1m
|
||||
# Limt memory to 1GB less than full Memory of the machine
|
||||
# -
|
||||
lxc.cgroup.memory.limit_in_bytes = $(( $(free -b | grep -oP '\d+' | head -n 1)-1000000000 ))
|
||||
\033[m
|
||||
"
|
||||
|
||||
echo ""
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user