At some point in any project implementation, need to troubleshoot the DB either to resolve the problem or performance.
Things to consider
1. Check the connection pool size
2. Fine Tune SQL statements
3. Execute "UPDATESTATS" at DB side to update the tablespace sizes and make updates to stats
4. Check the webserver I/O timeout , if it is very low (like 10sec) sometime you may receive the 500 (server timeout). HTTP server timeout should be aggregate of considering DB response time + application response time
5. Considering the option of creating materialized view or MQT(materialized query table).