A Crash Course in Analyzing Memory Usage in Ruby
11-Aug-2017 2567
The app handles a number of legacy URL paths, and redirects each one to a configurable location. This is implemented as a custom middleware. When the app boots we load the YAML configuration, which maps from legacy paths to new paths, into a hash (both keys and values are strings). When a request arrives, we look up the path in the hash, if an entry exists, return a 301 (Moved Permanently) with a Location of the new path. Otherwise the request is passed on to the app. Initially there were a few hundred redirects and everything worked great. Then we learned that rather than a few hundred mappings we needed to handle many thousands.
A Crash Course in Analyzing Memory Usage in Ruby #ruby #rubydeveloper #rubyonrails #Crash #Course #Analyzing #Memory #Usage https://rubyonrails.ba/link/a-crash-course-in-analyzing-memory-usage-in-ruby