How can I profile a Rails app in its entirety, not just controllers? [duplicate]

荒凉一梦 提交于 2019-12-12 09:09:44

问题


Possible Duplicate:
What tools do you recommend to profile Rails apps?

My rails app is taking ~2 seconds to respond to POST requests, and I can't figure out why. When I use traditional profiling tools like newrelic or things that hook into unit tests, they tell me that all of my requests are fast, taking under 20 ms. But when I actually time the requests, they are taking 2 seconds. GET requests are fast. This happens in both development and production mode, using mongrel. So my suspicion is that some gem is doing needless work. How can I track this down? If this was some other sort of server rather than Rails, I would just profile the running server, but the Rails profiling solutions all seem to just profile the controller code.


回答1:


The well know ruby-prof may help you. The config.ru file of your rails app will give you some hints on running the app manually.

For other alternatives take a look at this question.



来源:https://stackoverflow.com/questions/6416247/how-can-i-profile-a-rails-app-in-its-entirety-not-just-controllers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!