Posts [ 2 ]

Topic: Leveraging view assets precompile and caching

We are new to scaling Ruby on Rails, but we have a very well performing (simple DB) site and scale our machine to 100% CPU, and have balanced our Apache and Ruby process to about 60 web requests per second, on a simple 4 core single slot Intel System. We are using 2 APM system to fine tune and learn, New Relic and Tracelytics. Each of them points to the render time as the primary culprit of the transaction time, over 100ms, the Apache time and Active Record time is each under 10 ms.

I figured I could get render (or html/template/view) processing well under 100ms as well with assets precompile and assets caching. So we tried.

1. bundle exec rake assets:precompile2. bundle install3, Railsenv is set to "production" in the apache virtual configuration4. The production.rb is the delivered one and it has all the right settings, and I have rails static asset server turned off.3. restarted the environment

But still New Relic and Tracelytics each show 100-120 ms in "view processing" time.

Re: Leveraging view assets precompile and caching

We built a form-based Rails app with minimal get requests and page payload size to put together a simpler app against our environment. This was very useful since we find that we can run through the compiled template code in 5-20ms which is what I would expect on modern piece of multi-core hardware for the overhead of this phase or layer of the Rails framework. We are decomposing our other application to see why we went to over 100ms.

I am still not totally clear how to be sure compiled is actually working perfectly but we point our Apache working directory into <app home>/appname/public and since we setup compiled with no errors we must be running with compiled templates.

If you have seen "comparable" data, or have some interesting test results let us know.