Hello
We experiencing freezes on UI when opening big threads with 1000+ messages.
We use MM for almost every thing in the company. And we have some threads where our CI and other bots post their messages, usually containing links to the event, like gitlab pipeline, grafana link etc. Time goes by and now some of these threads contains about 2000 posts. When user clicks on them, page freezes for seconds or minutes. Our users now using 3-5 Chrome tabs to navigate the MM
I want confirm first whether it’s a client side problem, or a server side problem. When you say “UI freezes”, does it mean that the response comes from the server, and then the UI freezes, or the UI freezes before the response comes from the server?
If you could open the Chrome developer tools, and click on the network tab, and then open such a long thread and capture a screen recording of the entire thing, that would be very useful for me.
If you have sensitive data, please feel free to DM me on https://community.mattermost.com, or just simply reply on this thread if it’s not.
I think it is on the client side. It is going like my whole tab is stopped, no requests, no response to clicks.
I’ve made a video and blurred the chat content but you can see what’s going on. Things started going slow at 0:20, and freeze about 0:32 lasting 20 secs
It’s recorded on Macbook with M3 Pro, restarted few hours before.
Thanks for sharing the video @deathjoin. That was insightful!
To debug this further, it would be good if you could capture a performance profile as well.
So, please do the same thing as before, but this time, click on the 3 dot menu on the top right of the developer console → More tools → Performance monitor. And then tick mark CPU Usage, JS heap size, DOM nodes, JS event listeners.
After this, please do the same thing as before. Click around threads and scroll up and down and capture the issue and share the video.
This will help us isolate where the freeze is coming from.
The UI freeze you’re experiencing with large threads containing 1000+ messages in Mattermost is likely due to the rendering and loading of a large number of messages at once. Here are some possible solutions:
Pagination or Lazy Loading: Implement pagination or lazy loading to load a limited number of messages at a time, rather than all 2000 messages. This can significantly improve performance.
Database Indexing: Ensure that your PostgreSQL database has proper indexes on the necessary tables (e.g., Posts, Channels). This can speed up query performance when loading messages.
Caching: Enable caching for frequently accessed data to reduce the load on your database and speed up the page rendering.
Mattermost Configuration: Adjust the Posts per Page setting in the Mattermost configuration to limit the number of posts loaded initially. This reduces the amount of data transferred.
Client-Side Performance: Ensure that the browser and Mattermost client are optimized for large message handling. Reducing unnecessary DOM manipulations and improving how messages are rendered can help.
Service Scaling: Consider scaling up your Mattermost service by adding more resources (CPU/memory) or distributing the load across multiple instances if the issue persists during high-traffic periods.
These changes should help mitigate the freezes and improve the user experience in threads with a high number of messages.