File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,18 @@ configure()
3636 [[ $PHPTHREADS -eq 0 ]] && PHPTHREADS=$( nproc )
3737 [[ $PHPTHREADS -lt 3 ]] && PHPTHREADS=3
3838 echo " Using $PHPTHREADS PHP threads"
39- sed -i " s|^pm.max_children =.*|pm.max_children = $PHPTHREADS |" " $CONF "
40- sed -i " s|^pm.max_spare_servers =.*|pm.max_spare_servers = $PHPTHREADS |" " $CONF "
41- sed -i " s|^pm.start_servers =.*|pm.start_servers = $PHPTHREADS |" " $CONF "
39+ sed -i " s|^pm =.*|pm = static|" " $CONF "
40+ sed -i " s|^pm.max_children =.*|pm.max_children = $PHPTHREADS |" " $CONF "
41+
42+ # DATABASE MEMORY
43+ AUTOMEM=$(( TOTAL_MEM * 40 / 100 ))
44+ local CONF=/etc/mysql/mariadb.conf.d/91-ncp.cnf
45+ local CURRENT_DB_MEM=$( grep " ^innodb_buffer_pool_size" " $CONF " | awk ' { print $3 }' )
46+ echo " Using $AUTOMEM memory for the database"
47+ [[ " $CURRENT_DB_MEM " != " $AUTOMEM " ]] && {
48+ sed -i " s|^innodb_buffer_pool_size =.*|innodb_buffer_pool_size = $AUTOMEM |" " $CONF "
49+ service mysql restart
50+ }
4251
4352 # RESTART PHP
4453 [[ " $PHPTHREADS " != " $CURRENT_THREADS " ]] || \
Original file line number Diff line number Diff line change 11
2- [ v1.7.1] ( https://github.com/nextcloud/nextcloudpi/commit/a077130 ) (2019-02-22) lamp: adjust mariadb parameters
2+ [ v1.8.2] ( https://github.com/nextcloud/nextcloudpi/commit/3315e2e ) (2019-02-23) nc-limits: autocalculate database memory
3+
4+ [ v1.8.1 ] ( https://github.com/nextcloud/nextcloudpi/commit/2a0dc38 ) (2019-02-22) lamp: adjust mariadb parameters
5+
6+ [ v1.8.0 ] ( https://github.com/nextcloud/nextcloudpi/commit/602b3f2 ) (2019-02-23) add nc-maintenance-mode (#809 )
37
48[ v1.7.0] ( https://github.com/nextcloud/nextcloudpi/commit/5e1ea77 ) (2019-02-17) add nc-restore-snapshot
59
You can’t perform that action at this time.
0 commit comments