mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Calculate PHP APC SHM size according to memory detected
This commit is contained in:
parent
483e6de842
commit
2b11ff4db0
@ -28,7 +28,28 @@
|
||||
# Set our operating platform
|
||||
PLATFORM=`cat /etc/platform`
|
||||
EXTENSIONSDIR="/usr/local/lib/php/20060613/"
|
||||
APCSHMEMSIZE="25"
|
||||
AVAILMEM=`cat /var/log/dmesg.boot | grep "memory" | grep "avail" | awk '{ print $5 }' | cut -d'(' -f2 | cut -d'M' -f1`
|
||||
|
||||
# Calculate APC SHM size according
|
||||
# to detected memory values
|
||||
if [ "$AVAILMEM" -lt "128" ]; then
|
||||
APCSHMEMSIZE="5"
|
||||
fi
|
||||
if [ "$AVAILMEM" -gt "128" ]; then
|
||||
APCSHMEMSIZE="25"
|
||||
fi
|
||||
if [ "$AVAILMEM" -gt "256" ]; then
|
||||
APCSHMEMSIZE="45"
|
||||
fi
|
||||
if [ "$AVAILMEM" -gt "384" ]; then
|
||||
APCSHMEMSIZE="65"
|
||||
fi
|
||||
if [ "$AVAILMEM" -gt "512" ]; then
|
||||
APCSHMEMSIZE="80"
|
||||
fi
|
||||
if [ "$AVAILMEM" -gt "784" ]; then
|
||||
APCSHMEMSIZE="100"
|
||||
fi
|
||||
|
||||
# Set upload directory
|
||||
if [ "$PLATFORM" = "embedded" -o "$PLATFORM" = "nanobsd" ]; then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user