Is your db in container? If so optimize the options e.g. innodb_buffer_pool_size, search forum for db optimization.
For advance understanding of what is happening:
- Use app traces to understand which requests cause problem Opentelemetry with Frappe framework? - #5 by revant_one
- Ankush explains more tricks here https://www.youtube.com/watch?v=KTWwvHnjF5w