Merge branch 'devel' of github.com:nextcloud/nextcloudpi into devel

This commit is contained in:
Tobias Knöppler 2023-04-24 11:16:09 +02:00
commit 16aa6c8055
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
3 changed files with 8 additions and 5 deletions

View File

@ -42,10 +42,13 @@ tmpl_php_max_filesize() {
}
tmpl_php_threads() {
local TOTAL_MEM="$( get_total_mem )"
local PHPTHREADS="$(find_app_param nc-limits PHPTHREADS)"
[[ $PHPTHREADS -eq 0 ]] && PHPTHREADS=$(nproc)
[[ $PHPTHREADS -lt 6 ]] && PHPTHREADS=6
echo -n "$PHPTHREADS"
# By default restricted by memory / 100MB
[[ $PHPTHREADS -eq 0 ]] && PHPTHREADS=$(( TOTAL_MEM / ( 100 * 1024 * 1024 ) ))
# Minimum 16
[[ $PHPTHREADS -lt 16 ]] && PHPTHREADS=16
echo -n "$PHPTHREADS"
}
configure()

View File

@ -2,7 +2,7 @@
"id": "nc-limits",
"name": "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",
"infotitle": "",
"params": [

View File

@ -9,7 +9,7 @@ if [[ "$1" == "--defaults" ]] || ! [[ -f "${BINDIR}/CONFIG/nc-limits.sh" ]]
then
echo "INFO: Restoring template to default settings" >&2
PHPTHREADS=6
PHPTHREADS=16
else
PHPTHREADS="$(source "${BINDIR}/CONFIG/nc-limits.sh"; tmpl_php_threads)"
fi