This is from a
Saying in a Rails site running the above, we can use Linux's top command to monitor the Rails application instances running condition, occupied by memory, the CPU consumption and so on, for example, a moment JavaEye site screenshot:
In this screenshot inside, we can know the process of Rails instances running state, but we can not know the exact, a current consumption of CPU time high exactly fcgi process the request in the implementation of which, if this be able to know exact information, the search performance bottlenecks have great help, so we look to change the following months the Magic:
At your Rails application's app / controllers / application.rb inside two additional filter, as follows:
- before_filter: set_process_name_from_request
- after_filter: unset_process_name_from_request
- def set_process_name_from_request
- $ 0 = request.path [0,16]
- def unset_process_name_from_request
- $ 0 = request.path [0,15] + "*"
before_filter :set_process_name_from_request after_filter :unset_process_name_from_request def set_process_name_from_request $0 = request.path[0,16] end def unset_process_name_from_request $0 = request.path[0,15] + "*" end
Ruby language at $ 0 is the command-line applications, because we fcgi way to start Rails, so the default display for dispatch.fcgi, but we are now to change the $ 0, put URI forced assignment to $ 0, then top will be deceived us :
Come give me show me the current handling of the request URI is / blog/283416, in fact, this is my blog: The domain model implementation of the concluding point of view.
Are not cool! Rails application if the request is being processed, then the top display / blog/283416, if the Rails application has processed the request, then the top display / blog/283416 *, then a full point, and give everyone had fun
Related Posts of At top monitor window displays the status of ongoing Rails request URL
http://www.javaeye.com/topic/295829 Shoes Ruby are cross-platform GUI applications, recently released a new version, it is a very interesting Ruby GUI client, the following are some characteristics of Introduction: 1. Cross-platform support for windo ...
System starts out abnormal information: Exiting / var/lib/gems/1.8/gems/rails-2.2.2/lib/initializer.rb: 530: in `send ': undefined method` cache_template_extensions =' for ActionView:: Base: Class (NoMethodError) from / var/lib/gems/1.8/gems/ ...
Learn today ruby, the ruby download and install, and then began to refer to the relevant entry-tutorial section of a small process running directly on the command line: ruby-e "print 'hello, yiditushe'", after the carriage return, prompt
1. Object Cache: fine-grained, in view of the table Record Level, transparent access, without changing the procedure code can greatly enhance the performance of web applications. ORM object cache is a magic weapon for the victory. 2. The merits of th ...
Ruby is a completely cross-platform object-oriented scripting language, built on the Ruby-based Web framework Ruby on Rails (ROR) is the field of web development is gaining increasing acceptance. ROR substantial use of the Ruby language features, Symbol i
Ruby Design Pattern This book is about a focus on aspects of design patterns book. This book user-friendly way to introduce the Ruby design patterns, including an overview of Ruby, the use of Template Method Transform algorithm, using the strategy of repl
Interactive Net Purchase Excellence Amazon purchase [Original title] The Ruby Programming Language Publishing ] [ O'Reilly Media, Inc. [Author] (United States) David Flanagan; Yukihiro Matsumoto Translator  LIAO Zhi-gang; Zhang Wo [Name] Books O
Shoes Ruby are cross-platform GUI applications, recently released a new version, it is a very interesting Ruby GUI client, the following are some characteristics of Introduction: 1. Cross-platform support for windows / linux / mac os 2. Very small, t ...
Lazy loading: Lazy loading mechanism is in order to avoid unnecessary performance overhead and put forward the so-called lazy loading is required when the real data at a time when the real implementation of the data load operation. At Hibernate provides f
Before a friend also wanted to study development of FLEX. Asked me to help him to be a small sample. Spent a weekend time, to integrate a sampleproject. Client: FLEX Server: Spring2.5 + Hibernate3.2 + Hibernate-annotations3.3.1 + MySQL5 FDS: BlazeDS3 IDE: