Thursday, June 29, 2023
If you have just started building your Rails app and discovered that your memory quota is reaching nearly 1 GB - that's not normal. Fortunately, I have the exact solution for you. I've successfully brought my Rails app - Receipt-AI's memory usage from 1 GB to 268 MB.
The default Puma worker pool size is 4, but you can reduce it if you are not using a lot of concurrent connections.
heroku config:set WEB_CONCURRENCY=1
It could be that the gems you used are not required for boot time. To determine how much memory your gems consume during boot time:
group :development do
and then run bundle install and
bundle exec derailed bundle:mem
Bear in mind that if any gems is set to
require: false, make sure to add require to the file where it is used.
Uncomment this gem in your Gemfile and run bundle install. This tool allows you to measure the speed of your HTML page. It's super straightforward.
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"
Rails has a built-in way to cache your view, as simple as:
<%= render partial: 'hero', cached: true %>
You should only use caching on partials that are used frequently and whose output does not change frequently, such as your home page, which is also the most visited.
I have read multiple sources that state the default value of RUBYGCHEAPGROWTHFACTOR in Ruby is 1.8. Some sources mention that it may vary depending on the Ruby version. Nevertheless, you can configure the value by running:
heroku config:set RUBY_GC_HEAP_GROWTH_FACTOR=1.03
With this approach, your Rails app will be running super crisp and smooth without the need to upgrade the dyno.
ruby on rails
Memory Quota Exceeded
Find your inner peaceStart texting receipts →
Receipt-AI with AI and SMSWhat's new? How does Receipt-AI grow as a startup
Use CaseQuickBooks Receipt Scanner with Receipt-AI Your Top Choice Xero Receipt App Generate a Simple Expense Report with AI and SMS Receipt Management for Small Businesses Receipt-AI: The Best Receipt Organizer Track Receipts with PO numbers for Construction Projects
Articles🔍 The new Search Engine for your Receipts ⭐️ Introducing the new Receipt Insight 2.0 Receipt-AI is Now Officially Available on the QuickBooks Store 🗂️ Folder AI 2.0 - Email First time vs Many many times Partnerships with QuickBooks Store From Humble Beginnings to Community Accomplishments Where can I find the receipts in QuickBooks or Xero? 7 reasons why your company should use Receipt-AI 🗂️ Introducing the new Folder AI As of today, Receipt-AI has reached a milestone of 100k in total expenses. Hollywood and Silicon Valley Text Receipts and PO Numbers for Construction Projects Two tigers cannot share the same mountain Why do we start Receipt-AI? QuickBooks Disconnected The best receipt scanner for QuickBooks Upload receipts to QuickBooks with SMS What is expense report? 📦 New Receipt Insights How to reduce memory usage for your Rails app - R14 - Memory Quota Exceeded in Ruby (MRI) From Free Trial to Paid Trial Receipt-AI new feature: Upload Receipts using Email How to switch hosting from Render to Heroku for your Ruby on Rails application Receipt-AI: Take a picture and text