Skip to content

Commit

Permalink
chore: matomo better mariadb config and systemd services
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgarel authored and root committed Mar 19, 2024
1 parent a8210a6 commit 0018356
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
14 changes: 12 additions & 2 deletions confs/matomo/mysql/mariadb.conf.d/90-off-configs.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,20 @@ innodb_flush_log_at_trx_commit=2
# use tmpfs
tmpdir=/run/mysqld

# from sqltunner, boosting high above to avoid disk hit
sort_buffer_size=268435456 # 256M
read_rnd_buffer_size=268435456 # 256M
innodb_buffer_pool_instances=20



# specific to use memory
# 20G out of 32G (should be 80% of RAM, but DB is not alone)
innodb_buffer_pool_size=20G
# 45G out of 62G (should be 80% of RAM, but DB is not alone)
innodb_buffer_pool_size=45G
innodb_log_buffer_size=2048M
# table size 64M / Go = 64*20
max_heap_table_size=1280M
tmp_table_size=1280M

# enable better perfs analysis
performance_schema = ON
3 changes: 2 additions & 1 deletion confs/matomo/systemd/matomo-archive.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Description=Archive matomo requests
Requires=mariadb.service

# email on failure
OnFailure=email-failures@matomo-archive.service
# 2024-03-14 AlexG: disabled temporarily because it's really too much emails
#OnFailure=email-failures@matomo-archive.service

[Service]
Environment=TZ=UTC
Expand Down
5 changes: 3 additions & 2 deletions confs/matomo/systemd/matomo-tracking@.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Requires=mariadb.service
Requires=redis-server.service

# email on failure
OnFailure=email-failures@matomo-archive.service
# 2024-03-15 ALEX temporarily disabled to avoid spamming !
#OnFailure=email-failures@matomo-tracking__%i.service

[Service]
Environment=TZ=UTC
Expand All @@ -20,4 +21,4 @@ StandardError=append:/var/log/matomo/matomo-tracking-%i-err.log
# note: we have to use TimeoutStartSec as it's a Type=oneshot service
TimeoutStartSec=2h
# clean lock (usefull in case of bad exit)
ExecStopPost=/usr/bin/php /var/www/html/matomo/console queuedtracking:lock-status --unlock=QueuedTrackingLock%i -n --ignore-warn
ExecStopPost=/usr/bin/php /var/www/html/matomo/console queuedtracking:lock-status --unlock=QueuedTrackingLock%i -n --ignore-warn --quiet

0 comments on commit 0018356

Please sign in to comment.