mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
parent
0f4de56086
commit
6750497924
@ -42,10 +42,13 @@ tmpl_php_max_filesize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tmpl_php_threads() {
|
tmpl_php_threads() {
|
||||||
|
local TOTAL_MEM="$( get_total_mem )"
|
||||||
local PHPTHREADS="$(find_app_param nc-limits PHPTHREADS)"
|
local PHPTHREADS="$(find_app_param nc-limits PHPTHREADS)"
|
||||||
[[ $PHPTHREADS -eq 0 ]] && PHPTHREADS=$(nproc)
|
# By default restricted by memory / 100MB
|
||||||
[[ $PHPTHREADS -lt 6 ]] && PHPTHREADS=6
|
[[ $PHPTHREADS -eq 0 ]] && PHPTHREADS=$(( TOTAL_MEM / ( 100 * 1024 * 1024 ) ))
|
||||||
echo -n "$PHPTHREADS"
|
# Minimum 16
|
||||||
|
[[ $PHPTHREADS -lt 16 ]] && PHPTHREADS=16
|
||||||
|
echo -n "$PHPTHREADS"
|
||||||
}
|
}
|
||||||
|
|
||||||
configure()
|
configure()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"id": "nc-limits",
|
"id": "nc-limits",
|
||||||
"name": "Nc-limits",
|
"name": "Nc-limits",
|
||||||
"title": "nc-limits",
|
"title": "nc-limits",
|
||||||
"description": "Configure system limits for NextCloudPi",
|
"description": "Configure system limits for NextcloudPi",
|
||||||
"info": "Examples: 200M or 2G. Write 0 for autoconfig",
|
"info": "Examples: 200M or 2G. Write 0 for autoconfig",
|
||||||
"infotitle": "",
|
"infotitle": "",
|
||||||
"params": [
|
"params": [
|
||||||
|
|||||||
@ -9,7 +9,7 @@ if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-limits.sh" ]]
|
|||||||
then
|
then
|
||||||
echo "INFO: Restoring template to default settings" >&2
|
echo "INFO: Restoring template to default settings" >&2
|
||||||
|
|
||||||
PHPTHREADS=6
|
PHPTHREADS=16
|
||||||
else
|
else
|
||||||
PHPTHREADS="$(source "${BINDIR}/CONFIG/nc-limits.sh"; tmpl_php_threads)"
|
PHPTHREADS="$(source "${BINDIR}/CONFIG/nc-limits.sh"; tmpl_php_threads)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user