I have a Flarum setup with > 3 million users and I'm having some issues regarding performance (kind of).
The forum responds very well, but sometimes it freezes for several seconds. It seems like it opens 2 or 3 pages really fast, then freezes for several seconds, then is fast again.
I'm seeking for information regarding how can I investigate the issue.
Flarum info: 0.1.0-beta.13, PHP 7.2.24-0, MySQL: 5.7.33.
Users: 3,239,811
Discussions: 8,390
Posts: 38,905
Server: Ubuntu 18.04.5 LTS (Bare metal)
RAM: 256Gb
HD: 256Gb
CPUs: 32
CPU is free (load average: 1.96 2.03 1.89)
Mem is 9.87G (from 256Gb available)
I don't have too much experience with MySQL (for MSSQL, I would run the SQL Profiler, wait some minutes and then it would tell me exactly which indexes are missing, etc.)
Server is running PHP via FPM on Nginx.
pm in on demand, max children = 256, start servers = 32, min spare servers = 16, max spare servers = 64, process idle timeout = 60s, max requests = 1024