As it happens often to coders, I had to take over someone else's code for this company, the server runs on Amazon Cloud (i2.xlarge) running ubuntu-saucy-13.10-amd64-server. (the guy left)
The server has 700GB SSD and 30GB RAM but my problem is the previous developer was lousy at writing SQL statements as well as the PHP scripts I see have terribly long and unecessary loops.
I thought of looking at PostgreSQL logs but then I still need to match queries to php pages (long and painful process).
Is there a way for me to tell which PHP page is doing the "most damage" to the server in terms of resource hog so I can start replacing the worst ones first?
Any help is greatly appreciated, I've been at this for awhile.