开发者

How can I figure out why my JRuby rails app takes too long to serve a page?

I'm using Tomcat to hold my rails application, but I found it took too long to serve a request for example:

Completed 200 OK in 11141ms (Views: 204.0ms | ActiveRecord: 218.0ms)

I'm wondering why it took about 11 seconds to complete the request. Views and ActiveRecord just took 400ms, what was rails doing in other 10 开发者_StackOverflowseconds?


There is no better way to debug performance problems than using a profiler. Yes, you can probably get away with logging stuff but it's painful to set up and it's not always possible, especially when problems are not in your code but someone else's. There's also BTrace but you need to know lots of internals which is time consuming and unnecessary.

So grab a profiler, run Tomcat and see for yourself. I prefer YourKit which costs $$$, but there's VisualVM which is free.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜