First, please make sure you’re using a supported version of SonarQube (v9.9 LTS or v10.0 right now). There have been significant improvements during the 9.x series, including in the realm of performance.
If you still face performance issues, I would suggest referring to this troubleshooting guide: