Open MorganFujimaka opened 2 years ago
Hi @MorganFujimaka, I can't say for sure, but loading the list of archives from the master database is probably to avoid issues any with ongoing archiving processes and read replica lag.
How many records are typically in matomo_archive_numeric_2022_*
by the of the month?
Hi @bx80, thank you for the prompt response!
We have ~140 000 rows in the matomo_archive_numeric_2022_*
tables toward the end of the month. Most of the rows are for our main website, other websites are not impacted by performance issues. We have 30 funnels, 95 goals, and 3 segments for our main website (which increase greatly the number of rows).
Thanks @MorganFujimaka, these details will be really helpful for understanding how we can improve performance in this area :+1:
During archiving we notice a lot of read queries causing CPU spikes on master DB:
We face performance issues toward the end of the month when a
matomo_archive_numeric_2022_**
table is becoming too big probably.The function that call the query: https://github.com/matomo-org/matomo/blob/296de5d46102cfcc7dddd322972edbc631bf2b54/core/DataAccess/Model.php#L436
Why does it query master DB and not a read replica? Thank you!