community-edition icon indicating copy to clipboard operation
community-edition copied to clipboard

Bump clickhouse server version

Open pcouy opened this issue 1 year ago • 2 comments

Fixes excessively high CPU and RAM usage on idling instance

All the following graphs are stacked CPU time / container, and the largest area is the clickhouse server. Spikes are not relevant except for the fact they indicate a restart of the plausible and clickhouse containers.

Upgrading from the latest compose file from the analytics repo caused the following increase in CPU usage from clickhouse

2024-12-04-141036_612x292_scrot

Upgrading clickhouse to the latest version brought it back to a much lower level

2024-12-04-141117_613x294_scrot

Notice how the CPU usage was steadily increasing after I upgraded (even across restarts of the docker container)

2024-12-04-140348_614x293_scrot

pcouy avatar Dec 04 '24 13:12 pcouy

After a longer test, the CPU and RAM load are still significantly higher than they were before the update.

Seems like restoring changes that were introduced in https://github.com/plausible/community-edition/pull/13 helps as well, but still nowhere clause the <1% CPU usage it was at before the update

Even though it is much less noticeable, the plausible container itself has doubled its CPU usage since the update.

~~Checking clickhouse's debug log shows that plausible is frequently performing queries in the background, even when there are no visitors to any of my websites~~

pcouy avatar Dec 04 '24 14:12 pcouy

I let it run for a while, and I confirm the tweaks from #13 helped decrease the CPU usage further

2024-12-04-170826_609x293_scrot

For reference, here's a graph showing the last 12 hours of CPU use, with numbers before updating, and after updating + applying the tweaks in this pull request

plausible_update_before_after

pcouy avatar Dec 04 '24 16:12 pcouy