Dear sir
I have full solution optimize tomcat.
Of course, MariaDB is very so default skill as a developer.
There are amazing diversity of optimizing solutions around the tomcat world.
memory usage, garbage collection, thread usage, request throughout, number of sessions, response time, database connection pool, error rates, uptime etc.
By the way, let's go more progress step by step.
Thanks