To set the stage, imagine if you will: A read-heavy Tomcat Application with MySQL on Red Hat Enterprise Linux with some problematic Java Class files which resulted in the application performing a lot of time-wasting operations and causing the application to perform very slowly. The server, a blade server with 10K SAS disk, 32GB RAM and 8 core xeon @ 3 GHZ.  I tried tuning MySQL and Tomcat, but the page loads got no faster no matter what types of optimizations were made.  My question is: if the bottleneck of an application is caused by the code itself, is it possible, and in what circumstances, would it render and type of server configuration useless?  My loose theory is that, if you have headroom in terms of resources, and the application itself is simply slow due to inefficiencies such as useless recursions, useless DB reads, etc.. then you are at that point limited by your transfer rate, clock speed, disk read speeds, etc.. things that tuning will not help, only new, faster hardware would address at that point.  Is that accurate?  Could someone elaborate on this?
If a buggy application underperforms, it it possible server tuning could have no affect?
linux;mysql;performance;tomcat;tuning