Some of those optimizations might only be possible on VPS or dedicated servers, not on shared hosting with cPanel.
MariaDB is an open-source fork of MySQL that provides better performance.
The nice part is that MariaDB is a "drop-in replacement" for MySQL, meaning that you can just install it over the current MySQL installation and it should work.
By default, MySQL won't use all the server resources. You have to tell MySQL explicitly how much memory it can use.
It is important to change your the
innodb-buffer-pool-size based on the available RAM size.
Here is a recommended MySQL config for an 8GB/4vCPU server:
[mysqld]# InnoDBinnodb_buffer_pool_size = 5500M # This should be around 70% of your total RAMinnodb_buffer_pool_instances = 6innodb_stats_on_metadata = 0innodb_log_file_size = 768M # Around 15-25% of buffer-pool-sizeinnodb_file_per_table = 1 # Don't fragment tables across filesinnodb_flush_log_at_trx_commit = 2 # Increases tracking write speedmax_connections = 100query_cache_type = 0 # Disable query cache, as app is write-intensivequery_cache_size = 0
The highest database usage in userTrack are usually the heatmaps and session recordings. By default userTrack keeps this data until the user associated with it is also removed.
If your database size grew too big, or you want to reduce the size before a server migration, you can safely delete old heatmaps and session recordings.
For example, if you only want to delete the oldest 50K heatmap entries and oldest 10K recordings you can run those MySQL queries:
// Clear old heatmap dataDELETE FROM ust_movements ORDER BY ID ASC limit 50000;DELETE FROM ust_clicks ORDER BY ID ASC limit 50000;// Clear old record dataDELETE FROM ust_records ORDER BY ID asc LIMIT 10000;DELETE FROM ust_partials ORDER BY ID asc LIMIT 10000;