We run a Woocommerce shop. The frontend is pretty ok, but the dashboard is really slow. The database is quite large (>2 GB) containing around 140.000 users and more than 50.0000 orders. I checked the performance on a staging server using the same theme and plugins, but a new and clean database. Dashboard performance did not improve significantly. Monitoring plugins is not easy. The P3 Profiler plugin hasn't been updated for years. Probably not a good way to go. The Query Monitor shows valuable information. However, measurements of loading time differ too much between reloads to use it. I then check performance using a temparary access plugin. It creates a token so that tools like Pingdom can check the pagespeed. Do you know a better way to perform these tests?
From a very high level, off the top of my head these are the main things that contribute to how long it takes to load a page in the dashboard in Wordpress:
- Application processing: PHP/Apache doing work
- Database processing: PHP calling MySQL and the time for queries to run
- External services - calling external API's from the browser or server, waiting for data to come back
- Network/loading time overhead. Waiting for the page to come to your browser, downloading other dependencies like .js and .css
Query Monitor and the Network tab in your browser dev tools are good basic tools here to focus in on which of these is your main concern. It's 90% likely that most of the time is spent in the database, but that's not always the case. Maybe a plugin does something stupid and counts up all 50,000 orders using inefficient PHP on every page load.
But you need to find out where the time is spent first - either focus in on database queries and see if it's those or not. Your point 'measurements of loading time differ too much between page loads' smells a lot to me like it points to a problem - might be worth updating your question with high level numbers from QM, particularly time spent on database queries, and any other big variances you notice in any other numbers.
Also getting familiar with server load tools will be useful - at the least what does
htop show you for server load, memory usage, which processes are busy, etc. What does this look like when your site feels fast compared to when it feels slow?