Mattermost is having difficulty with the database. Is the postgres service running? What do its logs say? Can you execute a manual query with psql? What’s the CPU / memory / disk / network IO like? I have a feeling you’re running into some kind of resource limitation.
Also, 9.9.3 is out. I don’t believe that’s the issue, but there’s always a possibility that you’ve encountered some odd corner case. v9 changelog - Mattermost documentation has details of changes between versions.