Ruby on Rails Thursday, December 5, 2019

On Tuesday, December 3, 2019 at 5:55:24 PM UTC-5, Daniel Baez wrote:
  • What is going wrong with your DB that its built-in caching is insufficient?
    • Load, there are millions of queries running a sec now, and the Active Model classes I want to update are read constantly but hardly ever written
Have you tested to be sure that Marshal.load is significantly faster than ActiveRecord instantiation from a query? Have you verified that the database queries are a significant portion of the time to handle the request?

Have you tried using Rails view caching? View caching also saves you the view rendering time, which is often the majority of the time spent handling a request.  For example, here's a typical page load from one of my apps: Completed 200 OK in 35ms (Views: 25.6ms | ActiveRecord: 4.3ms). At millions of requests per second, I'd gain almost nothing by reducing the ActiveRecord time from 4.3ms to 1ms, compared to using the various elements of view caching that are already well supported and documented.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e4fafafd-91c8-4a1c-ad52-0899eb5c8d7d%40googlegroups.com.

No comments:

Post a Comment