From 17d69342084acda3fcbade5ff867cee57eb8e16c Mon Sep 17 00:00:00 2001 From: "Carrie Warner (Mattermost)" <74422101+cwarnermm@users.noreply.github.com> Date: Mon, 29 May 2023 09:02:14 -0400 Subject: [PATCH 1/2] Update high-scale-troubleshoot.rst --- source/deploy/high-scale-troubleshoot.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/deploy/high-scale-troubleshoot.rst b/source/deploy/high-scale-troubleshoot.rst index beacc3e2cf7..a53bd5a33b4 100644 --- a/source/deploy/high-scale-troubleshoot.rst +++ b/source/deploy/high-scale-troubleshoot.rst @@ -12,4 +12,18 @@ My system keeps hanging when I search for a message in Mattermost First, check how many messages have been posted on your system, including deleted posts and posts made using automations. -Go to the **System Console > Reporting > Site Statistics** and review the **Total Posts** figure reported. If this figure is above 3,000,000 posts, we recommend deploying Elasticsearch alongside your Mattermost server for improved search performance. Follow our guides to `deploy an Elasticsearch server `__. \ No newline at end of file +Go to the **System Console > Reporting > Site Statistics** and review the **Total Posts** figure reported. If this figure is above 3,000,000 posts, we recommend deploying Elasticsearch alongside your Mattermost server for improved search performance. Follow our guides to `deploy an Elasticsearch server `__. + +How to troubleshoot server-side performance issues without Prometheus or Grafana? +----------------------------------------------------------------------------------- + +Enable slow query logging in PostgreSQL and leave it enabled to gather data over time. PostgreSQL's slow query log helps you identify queries that take longer than a specified amount of time. The slow query log isn't enabled by default, and must be enabled manually. + +To enable slow query logging globally, change the following line in postgresql.conf and reload the page: ``log_min_duration_statement = 5000``. When you this value to ``5000``, PostgreSQL considers queries that take longer than 5 seconds to be slow queries and logs them in the log file. + +To enable slow query logging for a specific database, use ``ALTER DATABASE`` to change the configuration parameter for a single database. For example: + +.. code-block:: none + + postgres=# ALTER DATABASE test SET log_min_duration_statement = 5000; + ALTER DATABASE From ebd1553d4668435353f0a7de459dd17c491e45e1 Mon Sep 17 00:00:00 2001 From: "Carrie Warner (Mattermost)" <74422101+cwarnermm@users.noreply.github.com> Date: Mon, 24 Jul 2023 09:25:38 -0400 Subject: [PATCH 2/2] Incorporated reviewer feedback --- source/deploy/high-scale-troubleshoot.rst | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/source/deploy/high-scale-troubleshoot.rst b/source/deploy/high-scale-troubleshoot.rst index a53bd5a33b4..e25518f5531 100644 --- a/source/deploy/high-scale-troubleshoot.rst +++ b/source/deploy/high-scale-troubleshoot.rst @@ -19,11 +19,6 @@ How to troubleshoot server-side performance issues without Prometheus or Grafana Enable slow query logging in PostgreSQL and leave it enabled to gather data over time. PostgreSQL's slow query log helps you identify queries that take longer than a specified amount of time. The slow query log isn't enabled by default, and must be enabled manually. -To enable slow query logging globally, change the following line in postgresql.conf and reload the page: ``log_min_duration_statement = 5000``. When you this value to ``5000``, PostgreSQL considers queries that take longer than 5 seconds to be slow queries and logs them in the log file. +To enable slow query logging globally, change the following line in ``postgresql.conf``: ``log_min_duration_statement = 1000``, then restart PostgreSQL. When you this value to ``1000``, PostgreSQL considers queries that take longer than 1 second to be slow queries and logs them in the log file. Alternatively, you can run ``SELECT pg_reload_conf();`` to reload the configuration without a restart. -To enable slow query logging for a specific database, use ``ALTER DATABASE`` to change the configuration parameter for a single database. For example: - -.. code-block:: none - - postgres=# ALTER DATABASE test SET log_min_duration_statement = 5000; - ALTER DATABASE +To enable slow query logging for a specific database, use ``ALTER DATABASE`` to change the configuration parameter for a single database. \ No newline at end of file