Here is the stack of my web app. Simply nginx + php-fpm + php5.3 + mysql + memcache. Recently we deployed some refactored code. Which involves SQL refactoring and caching adjustments. We found that after the deployment, the server load had an sharp growth. The memory usage climbed even sharper. And from the top command many php-fpm processes were using 2 times of memories than before. So yes there's something wrong in the deployed code. The problem only occured in production env, in test & dev envs it's all fine, so it's correlated to traffic.
My question is generally how can I find out which requests(scripts) or which parts of my code are consuming too much memory? What's the easiest way to find out?
Thanks a lot.