try to debug the php code that is running (f.e. with xhprof to check
which part of the code consumes the cpu time) and search for slow
queries in mysql (you should enable logging slow queries in mysql’s
configuration). then you should optimize php code and sql queries
(first try with http://dev.mysql.com/doc/refman/5.0/en/using-explain.html).
‘show processlist’ as an sql query can help you bring closer to the
solution quickly. adding indexes to tables can be a quick fix to most
of sql related performance issues if not already added and the queries
seem ok.