Configure Swapfile
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo cp /etc/fstab /etc/fstab.bak
sudo nano /etc/fstab
Add the following line at the end, save and close:
/swapfile swap swap defaults 0 0
sudo sysctl vm.swappiness=10
sudo vi /etc/sysctl.conf
Add the following line at the end, save and close:
vm.swappiness=10
Configure PHP
sudo nano /opt/bitnami/php/etc/memory.conf
; Bitnami memory configuration for PHP-FPM
;
; Note: This will be modified on server size changes
pm.max_children=10
pm.start_servers=2
pm.min_spare_servers=2
pm.max_spare_servers=10
pm.max_requests=5000
Configure MariaDB (MySQL)
sudo nano /opt/bitnami/mariadb/conf/bitnami/memory.conf
[mysqld]
#wait_timeout = 120
long_query_time = 1
query_cache_limit=2M
query_cache_type=1
query_cache_size=8M
innodb_buffer_pool_size=16M
#innodb_log_file_size=128M
#innodb_flush_method=O_DIRECT
tmp_table_size=16M
max_connections = 100
max_user_connections = 250
key_buffer_size=8M
sudo /opt/bitnami/ctlscript.sh restart