{"id":41669,"date":"2026-11-30T11:11:08","date_gmt":"2026-11-30T11:11:08","guid":{"rendered":"https:\/\/www.railscarma.com\/?p=41669"},"modified":"2026-11-30T11:16:22","modified_gmt":"2026-11-30T11:16:22","slug":"ruby-on-rails-performance-optimization-diagnosis","status":"publish","type":"post","link":"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/ruby-on-rails-performance-optimization-diagnosis\/","title":{"rendered":"Slow Rails Applications: How to Separate Database, Background Job and Infrastructure Problems"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"41669\" class=\"elementor elementor-41669\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d1e70b0 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d1e70b0\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8db9da6\" data-id=\"8db9da6\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5776070 elementor-widget elementor-widget-text-editor\" data-id=\"5776070\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"font-weight: 400;\">Which page is slow, for which users, and since when? If nobody on the team can answer all three, the application isn&#8217;t ready for Ruby on Rails performance optimization, because every fix will be a guess. Most &#8220;slow Rails app&#8221; tickets turn out to be one of three different problems, and each one needs a different fix.<\/span><\/p><p><span style=\"font-weight: 400;\">The three are the database, the background job queue and the infrastructure around the app. This guide shows the signs of each, a cheap way to confirm it, and what to change first. The Rails details come from the Rails 8.1 guides and the PostgreSQL documentation.<\/span><\/p><h2><b>Pin down what &#8220;slow&#8221; means first<\/b><\/h2><p><span style=\"font-weight: 400;\">Pick one endpoint and one time window, and write down the number. A median request time hides the users having a bad day, so record a high percentile such as the 95th as well. Note whether the slowness appeared after a deploy, after a data import or gradually as the tables grew.<\/span><\/p><p><span style=\"font-weight: 400;\">Then split the request time. Rails publishes a process_action.action_controller event whose payload includes view_runtime and db_runtime, both in milliseconds, as the <\/span><a href=\"https:\/\/guides.rubyonrails.org\/active_support_instrumentation.html\"><span style=\"font-weight: 400;\">instrumentation guide<\/span><\/a><span style=\"font-weight: 400;\"> documents. If database time dominates, read the next section. If neither number accounts for most of the total, the time is going somewhere else: an outbound API call, a lock, or the request waiting before Rails ever sees it.<\/span><\/p><h2><b>Database: pages that get slower as the data grows<\/b><\/h2><p><span style=\"font-weight: 400;\">A database problem usually shows up as request time that tracks the number of rows or records on the page. A dashboard that was fine with 50 customers and crawls with 5,000 is the classic case.<\/span><\/p><p><span style=\"font-weight: 400;\">The most common cause in Rails code is the N+1 pattern, where a loop loads an association once per record. The <\/span><a href=\"https:\/\/guides.rubyonrails.org\/active_record_querying.html\"><span style=\"font-weight: 400;\">Active Record querying guide<\/span><\/a><span style=\"font-weight: 400;\"> covers three fixes with different behavior. preload loads each association with its own query, eager_load uses a LEFT OUTER JOIN and allows conditions on the association, and includes picks between them. Choosing wrongly can swap many small queries for one huge join, so check the result rather than assuming.<\/span><\/p><p><span style=\"font-weight: 400;\">To find the queries that matter, enable the <\/span><a href=\"https:\/\/www.postgresql.org\/docs\/current\/pgstatstatements.html\"><span style=\"font-weight: 400;\">pg_stat_statements<\/span><\/a><span style=\"font-weight: 400;\"> module. It records execution counts and timings per normalized statement, but it needs a shared_preload_libraries entry and a server restart, so plan a window. Sort by total execution time, not by the slowest single call. A query that takes 5 milliseconds and runs fifty thousand times an hour costs more than one that takes two seconds and runs twice.<\/span><\/p><p><span style=\"font-weight: 400;\">Then look at the plan of the worst offender with EXPLAIN ANALYZE. The PostgreSQL manual warns that this <\/span><a href=\"https:\/\/www.postgresql.org\/docs\/current\/sql-explain.html\"><span style=\"font-weight: 400;\">actually executes the statement<\/span><\/a><span style=\"font-weight: 400;\">, so wrap anything that writes data in a transaction and roll it back. A missing index and a plan that scans a whole table are the usual findings. Fix those before reaching for caching, which can hide a query problem without removing it.<\/span><\/p><h2><b>Background jobs: fast pages, late results<\/b><\/h2><p><span style=\"font-weight: 400;\">When the web requests look healthy but users complain that emails, exports or webhooks arrive late, look at the queue. The symptom is delay, not slow pages.<\/span><\/p><p><span style=\"font-weight: 400;\">Measure queue latency, which is how long the oldest waiting job has been there. The Sidekiq wiki recommends <\/span><a href=\"https:\/\/github.com\/sidekiq\/sidekiq\/wiki\/Monitoring\"><span style=\"font-weight: 400;\">monitoring latency instead of backlog size<\/span><\/a><span style=\"font-weight: 400;\">, because backlog size can raise false alarms while a job that has waited a long time is what users actually feel. Its example alert fires when jobs wait more than 30 seconds, and you should choose your own threshold from what each job type promises users.<\/span><\/p><p><span style=\"font-weight: 400;\">Check the adapter before tuning anything. The <\/span><a href=\"https:\/\/guides.rubyonrails.org\/active_job_basics.html\"><span style=\"font-weight: 400;\">Active Job guide<\/span><\/a><span style=\"font-weight: 400;\"> describes the async adapter as an in-process queue that keeps jobs in memory, and says outstanding jobs are lost if the process crashes or the machine restarts. Since Rails 8.0 the default queue backend is Solid Queue. If a production app still runs jobs in-process, late jobs may be the milder symptom. Lost jobs are worse.<\/span><\/p><p><span style=\"font-weight: 400;\">If latency is high on a healthy adapter, the usual causes are one slow job type blocking fast ones and too few workers for the load. Separating queues by urgency, so a large report export can&#8217;t hold up a password reset email, is often the first change. Job code has its own database time too: the perform.active_job event reports db_runtime, so the database checks above apply to jobs as well.<\/span><\/p><h2><b>Infrastructure: everything is slow at once<\/b><\/h2><p><span style=\"font-weight: 400;\">If trivial endpoints slow down together, and database time stays low, suspect the layer under Rails. Signs include slowness that tracks traffic peaks or deploys, one host that behaves worse than its neighbors, and requests that wait before the application starts working on them.<\/span><\/p><p><span style=\"font-weight: 400;\">Confirm it by comparing the same endpoint across hosts and over time, and by checking CPU, memory and swap on the app servers during the slow period. Check whether the number of web processes and threads matches the load, and how long requests wait in the load balancer or web server queue. That wait doesn&#8217;t appear in Rails&#8217; own timings, which is why people miss it.<\/span><\/p><p><span style=\"font-weight: 400;\">Be careful with the instinct to add servers. If the database is the bottleneck, more app servers open more connections to it and can make things worse. Treat extra capacity as an experiment with a before and after measurement, not as the first answer.<\/span><\/p><h2><b>When the time isn&#8217;t in any of the three<\/b><\/h2><p><span style=\"font-weight: 400;\">Sometimes the split shows database and job numbers that look fine while the request is still slow. Look at outbound calls first. A payment gateway, a shipping rate lookup or a webhook sent inside the request can add seconds that no query log will show. If the call doesn&#8217;t need to finish before the user sees a response, move it into a job. If it does, set an explicit timeout and decide what the page should do when the call fails.<\/span><\/p><p><span style=\"font-weight: 400;\">Lock waits are the other quiet culprit. Two requests updating the same rows can queue behind each other, and the symptom is a slowdown that appears only under concurrent use. Your database logs and its lock views will show it when you look at the slow window rather than at an average.<\/span><\/p><h2><b>A made-up example of how the pieces separate<\/b><\/h2><p><span style=\"font-weight: 400;\">This is hypothetical, invented for illustration, and describes no real project. A SaaS product gets complaints that its monthly report page &#8220;times out&#8221;. The request log shows most of the time in the database. pg_stat_statements points to one query called thousands of times per page view, which turns out to be an N+1 on line items. An includes fix removes it.<\/span><\/p><p><span style=\"font-weight: 400;\">The same team also hears that invoice emails arrive an hour late. Queue latency shows the cause: report exports and email jobs share one queue, and exports win. Moving them to separate queues fixes it. Two complaints, two causes, and neither needed a bigger server.<\/span><\/p><h2><b>What to capture before you change anything<\/b><\/h2><ul><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A named endpoint or job, with its high-percentile time and a date range.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The split between database, view and other time for that endpoint.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The ten most expensive statements by total execution time.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Queue latency per queue, and the adapter in use.<\/span><\/li><li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">CPU, memory and request queue time on the app hosts during the slow window.<\/span><\/li><\/ul><p><span style=\"font-weight: 400;\">Change one thing at a time and re-measure. A release that adds an index, moves a queue and resizes a server tells you nothing about which of them worked.<\/span><\/p><h2><b>Where outside help fits<\/b><\/h2><p><span style=\"font-weight: 400;\">An existing application with unclear history is the case where a second pair of eyes saves time. RailsCarma&#8217;s <\/span><a href=\"https:\/\/www.railscarma.com\/ja\/ruby-on-rails%e3%82%b3%e3%83%b3%e3%82%b5%e3%83%ab%e3%83%86%e3%82%a3%e3%83%b3%e3%82%b0\/\"><span style=\"font-weight: 400;\">Ruby on Rails\u30b3\u30f3\u30b5\u30eb\u30c6\u30a3\u30f3\u30b0<\/span><\/a><span style=\"font-weight: 400;\"> page describes reviewing existing Rails applications for issues, and its <\/span><a href=\"https:\/\/www.railscarma.com\/ja\/%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%ae%e3%82%b5%e3%83%9d%e3%83%bc%e3%83%88%e3%81%a8%e3%83%a1%e3%83%b3%e3%83%86%e3%83%8a%e3%83%b3%e3%82%b9\/\"><span style=\"font-weight: 400;\">\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b5\u30dd\u30fc\u30c8\u3068\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9<\/span><\/a><span style=\"font-weight: 400;\"> service covers ongoing support under SLAs once the fixes are in.<\/span><\/p><h2><b>Measure first, then spend<\/b><\/h2><p><span style=\"font-weight: 400;\">A slow application feels like one problem, but it usually hides two or three. Split the time, confirm each suspect with a number, and fix the biggest one. Speak with RailsCarma&#8217;s team to review your application&#8217;s performance bottlenecks and define a practical fix list.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t  <div class=\"related-post slider\">\r\n        <div class=\"headline\">\u95a2\u9023\u8a18\u4e8b<\/div>\r\n    <div class=\"post-list owl-carousel\">\r\n\r\n            <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"Slow Rails Applications: How to Separate Database, Background Job and Infrastructure Problems\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/ruby-on-rails-performance-optimization-diagnosis\/?related_post_from=41669\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png\" class=\"attachment-full size-full wp-post-image\" alt=\"Ruby on Rails Performance Optimization\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"Slow Rails Applications: How to Separate Database, Background Job and Infrastructure Problems\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/ruby-on-rails-performance-optimization-diagnosis\/?related_post_from=41669\">\r\n        Slow Rails Applications: How to Separate Database, Background Job and Infrastructure Problems  <\/a>\r\n\r\n        <\/div>\r\n              <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"What Does a Rails Upgrade Cost? Dependencies, Test Coverage and Deployment Risk\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/ruby-on-rails-upgrade-cost\/?related_post_from=41657\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Upgrade-Cost.png\" class=\"attachment-full size-full wp-post-image\" alt=\"What Does a Rails Upgrade Cost? Dependencies, Test Coverage and Deployment Risk\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Upgrade-Cost.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Upgrade-Cost-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Upgrade-Cost-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Upgrade-Cost-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"What Does a Rails Upgrade Cost? Dependencies, Test Coverage and Deployment Risk\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/ruby-on-rails-upgrade-cost\/?related_post_from=41657\">\r\n        What Does a Rails Upgrade Cost? Dependencies, Test Coverage and Deployment Risk  <\/a>\r\n\r\n        <\/div>\r\n              <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"Rails Upgrade Testing: How to Reduce Release Risk When Test Coverage Is Limited\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/rails-upgrade-testing-limited-test-coverage\/?related_post_from=41651\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Rails-Upgrade-Testing.png\" class=\"attachment-full size-full wp-post-image\" alt=\"Rails Upgrade Testing\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Rails-Upgrade-Testing.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Rails-Upgrade-Testing-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Rails-Upgrade-Testing-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Rails-Upgrade-Testing-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"Rails Upgrade Testing: How to Reduce Release Risk When Test Coverage Is Limited\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/rails-upgrade-testing-limited-test-coverage\/?related_post_from=41651\">\r\n        Rails Upgrade Testing: How to Reduce Release Risk When Test Coverage Is Limited  <\/a>\r\n\r\n        <\/div>\r\n              <div class=\"item\">\r\n            <div class=\"thumb post_thumb\">\r\n    <a  title=\"Multi-Vendor Marketplace Development with Ruby on Rails: A Complete Guide\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/multi-vendor-marketplace-development-with-ruby-on-rails\/?related_post_from=41636\">\r\n\r\n      <img decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Multi-Vendor-Marketplace-Development-with-Ruby-on-Rails.png\" class=\"attachment-full size-full wp-post-image\" alt=\"Multi-Vendor Marketplace Development with Ruby on Rails\" srcset=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Multi-Vendor-Marketplace-Development-with-Ruby-on-Rails.png 800w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Multi-Vendor-Marketplace-Development-with-Ruby-on-Rails-300x113.png 300w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Multi-Vendor-Marketplace-Development-with-Ruby-on-Rails-768x288.png 768w, https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Multi-Vendor-Marketplace-Development-with-Ruby-on-Rails-18x7.png 18w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\r\n\r\n    <\/a>\r\n  <\/div>\r\n\r\n  <a class=\"title post_title\"  title=\"Multi-Vendor Marketplace Development with Ruby on Rails: A Complete Guide\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/multi-vendor-marketplace-development-with-ruby-on-rails\/?related_post_from=41636\">\r\n        Multi-Vendor Marketplace Development with Ruby on Rails: A Complete Guide  <\/a>\r\n\r\n        <\/div>\r\n      \r\n  <\/div>\r\n\r\n  <script>\r\n      <\/script>\r\n  <style>\r\n    .related-post {}\r\n\r\n    .related-post .post-list {\r\n      text-align: left;\r\n          }\r\n\r\n    .related-post .post-list .item {\r\n      margin: 10px;\r\n      padding: 10px;\r\n          }\r\n\r\n    .related-post .headline {\r\n      font-size: 14px !important;\r\n      color: #999999 !important;\r\n          }\r\n\r\n    .related-post .post-list .item .post_thumb {\r\n      max-height: 220px;\r\n      margin: 10px 0px;\r\n      padding: 0px;\r\n      display: block;\r\n          }\r\n\r\n    .related-post .post-list .item .post_title {\r\n      font-size: 14px;\r\n      color: #000000;\r\n      margin: 10px 0px;\r\n      padding: 0px;\r\n      display: block;\r\n      text-decoration: none;\r\n          }\r\n\r\n    .related-post .post-list .item .post_excerpt {\r\n      font-size: 12px;\r\n      color: #3f3f3f;\r\n      margin: 10px 0px;\r\n      padding: 0px;\r\n      display: block;\r\n      text-decoration: none;\r\n          }\r\n\r\n    .related-post .owl-dots .owl-dot {\r\n          }\r\n\r\n      <\/style>\r\n      <script>\r\n      jQuery(document).ready(function($) {\r\n        $(\".related-post .post-list\").owlCarousel({\r\n          items: 2,\r\n          responsiveClass: true,\r\n          responsive: {\r\n            0: {\r\n              items: 1,\r\n            },\r\n            768: {\r\n              items: 2,\r\n            },\r\n            1200: {\r\n              items: 2,\r\n            }\r\n          },\r\n                      rewind: true,\r\n                                loop: true,\r\n                                center: false,\r\n                                autoplay: true,\r\n            autoplayHoverPause: true,\r\n                                nav: true,\r\n            navSpeed: 1000,\r\n            navText: ['<i class=\"fas fa-chevron-left\"><\/i>', '<i class=\"fas fa-chevron-right\"><\/i>'],\r\n                                dots: false,\r\n            dotsSpeed: 1200,\r\n                                                    rtl: false,\r\n          \r\n        });\r\n      });\r\n    <\/script>\r\n  <\/div>","protected":false},"excerpt":{"rendered":"<p>Which page is slow, for which users, and since when? If nobody on the team can answer all three, the application isn&#8217;t ready for Ruby on Rails performance optimization, because every fix will be a guess. Most &#8220;slow Rails app&#8221; tickets turn out to be one of three different problems, and each one needs a different fix. The three are the database, the background job queue and the infrastructure around the app. This guide shows the signs of each, a cheap way to confirm it, and what to change first. The Rails details come from the Rails 8.1 guides and the PostgreSQL documentation. Pin down what &#8220;slow&#8221; means first Pick &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.railscarma.com\/ja\/%e3%83%96%e3%83%ad%e3%82%b0\/multi-vendor-marketplace-development-with-ruby-on-rails\/\"> <span class=\"screen-reader-text\">Multi-Vendor Marketplace Development with Ruby on Rails: A Complete Guide<\/span> \u3082\u3063\u3068\u8aad\u3080 \"<\/a><\/p>","protected":false},"author":5,"featured_media":41677,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1224],"tags":[],"class_list":["post-41669","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ruby on Rails Performance Optimization: Find the Cause -<\/title>\n<meta name=\"description\" content=\"Slow Rails app? Learn to tell database, background job and infrastructure problems apart before you optimize, with checks you can run this.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.railscarma.com\/ja\/\u30d6\u30ed\u30b0\/ruby-on-rails-performance-optimization-diagnosis\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ruby on Rails Performance Optimization: Find the Cause -\" \/>\n<meta property=\"og:description\" content=\"Slow Rails app? Learn to tell database, background job and infrastructure problems apart before you optimize, with checks you can run this.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.railscarma.com\/ja\/\u30d6\u30ed\u30b0\/ruby-on-rails-performance-optimization-diagnosis\/\" \/>\n<meta property=\"og:site_name\" content=\"RailsCarma - Ruby on Rails Development Company specializing in Offshore Development\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RailsCarma\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-30T11:11:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-30T11:16:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nikhil\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@railscarma\" \/>\n<meta name=\"twitter:site\" content=\"@railscarma\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikhil\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"6\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/\"},\"author\":{\"name\":\"Nikhil\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/person\/1aa0357392b349082303e8222c35c30c\"},\"headline\":\"Slow Rails Applications: How to Separate Database, Background Job and Infrastructure Problems\",\"datePublished\":\"2026-11-30T11:11:08+00:00\",\"dateModified\":\"2026-11-30T11:16:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/\"},\"wordCount\":1350,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.railscarma.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png\",\"articleSection\":[\"Blogs\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/\",\"url\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/\",\"name\":\"Ruby on Rails Performance Optimization: Find the Cause -\",\"isPartOf\":{\"@id\":\"https:\/\/www.railscarma.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png\",\"datePublished\":\"2026-11-30T11:11:08+00:00\",\"dateModified\":\"2026-11-30T11:16:22+00:00\",\"description\":\"Slow Rails app? Learn to tell database, background job and infrastructure problems apart before you optimize, with checks you can run this.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#primaryimage\",\"url\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png\",\"contentUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png\",\"width\":800,\"height\":300,\"caption\":\"Ruby on Rails Performance Optimization\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.railscarma.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Slow Rails Applications: How to Separate Database, Background Job and Infrastructure Problems\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.railscarma.com\/#website\",\"url\":\"https:\/\/www.railscarma.com\/\",\"name\":\"RailsCarma - Ruby on Rails Development Company specializing in Offshore Development\",\"description\":\"RailsCarma is a Ruby on Rails Development Company in Bangalore. We specialize in Offshore Ruby on Rails Development based out in USA and India. Hire experienced Ruby on Rails developers for the ultimate Web Experience.\",\"publisher\":{\"@id\":\"https:\/\/www.railscarma.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.railscarma.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.railscarma.com\/#organization\",\"name\":\"RailsCarma\",\"url\":\"https:\/\/www.railscarma.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png\",\"contentUrl\":\"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png\",\"width\":200,\"height\":46,\"caption\":\"RailsCarma\"},\"image\":{\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/RailsCarma\/\",\"https:\/\/x.com\/railscarma\",\"https:\/\/www.linkedin.com\/company\/railscarma\/\",\"https:\/\/myspace.com\/railscarma\",\"https:\/\/in.pinterest.com\/railscarma\/\",\"https:\/\/www.youtube.com\/channel\/UCx3Wil-aAnDARuatTEyMdpg\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/person\/1aa0357392b349082303e8222c35c30c\",\"name\":\"Nikhil\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.railscarma.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/054f31ff35e9917aaf631b8025ef679d42dd21792012d451763138d66d02a4c0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/054f31ff35e9917aaf631b8025ef679d42dd21792012d451763138d66d02a4c0?s=96&d=mm&r=g\",\"caption\":\"Nikhil\"},\"sameAs\":[\"https:\/\/www.railscarma.com\/hire-ruby-on-rails-developer\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ruby on Rails Performance Optimization: Find the Cause -","description":"Slow Rails app? Learn to tell database, background job and infrastructure problems apart before you optimize, with checks you can run this.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.railscarma.com\/ja\/\u30d6\u30ed\u30b0\/ruby-on-rails-performance-optimization-diagnosis\/","og_locale":"ja_JP","og_type":"article","og_title":"Ruby on Rails Performance Optimization: Find the Cause -","og_description":"Slow Rails app? Learn to tell database, background job and infrastructure problems apart before you optimize, with checks you can run this.","og_url":"https:\/\/www.railscarma.com\/ja\/\u30d6\u30ed\u30b0\/ruby-on-rails-performance-optimization-diagnosis\/","og_site_name":"RailsCarma - Ruby on Rails Development Company specializing in Offshore Development","article_publisher":"https:\/\/www.facebook.com\/RailsCarma\/","article_published_time":"2026-11-30T11:11:08+00:00","article_modified_time":"2026-11-30T11:16:22+00:00","og_image":[{"width":800,"height":300,"url":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png","type":"image\/png"}],"author":"Nikhil","twitter_card":"summary_large_image","twitter_creator":"@railscarma","twitter_site":"@railscarma","twitter_misc":{"\u57f7\u7b46\u8005":"Nikhil","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"6\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#article","isPartOf":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/"},"author":{"name":"Nikhil","@id":"https:\/\/www.railscarma.com\/#\/schema\/person\/1aa0357392b349082303e8222c35c30c"},"headline":"Slow Rails Applications: How to Separate Database, Background Job and Infrastructure Problems","datePublished":"2026-11-30T11:11:08+00:00","dateModified":"2026-11-30T11:16:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/"},"wordCount":1350,"commentCount":0,"publisher":{"@id":"https:\/\/www.railscarma.com\/#organization"},"image":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#primaryimage"},"thumbnailUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png","articleSection":["Blogs"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/","url":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/","name":"Ruby on Rails Performance Optimization: Find the Cause -","isPartOf":{"@id":"https:\/\/www.railscarma.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#primaryimage"},"image":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#primaryimage"},"thumbnailUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png","datePublished":"2026-11-30T11:11:08+00:00","dateModified":"2026-11-30T11:16:22+00:00","description":"Slow Rails app? Learn to tell database, background job and infrastructure problems apart before you optimize, with checks you can run this.","breadcrumb":{"@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#primaryimage","url":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png","contentUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2026\/11\/Ruby-on-Rails-Performance-Optimization.png","width":800,"height":300,"caption":"Ruby on Rails Performance Optimization"},{"@type":"BreadcrumbList","@id":"https:\/\/www.railscarma.com\/blog\/ruby-on-rails-performance-optimization-diagnosis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.railscarma.com\/"},{"@type":"ListItem","position":2,"name":"Slow Rails Applications: How to Separate Database, Background Job and Infrastructure Problems"}]},{"@type":"WebSite","@id":"https:\/\/www.railscarma.com\/#website","url":"https:\/\/www.railscarma.com\/","name":"RailsCarma - \u30aa\u30d5\u30b7\u30e7\u30a2\u958b\u767a\u306b\u7279\u5316\u3057\u305f Ruby on Rails \u958b\u767a\u4f1a\u793e","description":"RailsCarma \u306f\u30d0\u30f3\u30ac\u30ed\u30fc\u30eb\u306e Ruby on Rails \u958b\u767a\u4f1a\u793e\u3067\u3059\u3002\u5f53\u793e\u306f\u7c73\u56fd\u3068\u30a4\u30f3\u30c9\u3092\u62e0\u70b9\u3068\u3059\u308b\u30aa\u30d5\u30b7\u30e7\u30a2 Ruby on Rails \u958b\u767a\u3092\u5c02\u9580\u3068\u3057\u3066\u3044\u307e\u3059\u3002\u7d4c\u9a13\u8c4a\u5bcc\u306a Ruby on Rails \u958b\u767a\u8005\u3092\u96c7\u3063\u3066\u3001\u7a76\u6975\u306e Web \u30a8\u30af\u30b9\u30da\u30ea\u30a8\u30f3\u30b9\u3092\u5b9f\u73fe\u3057\u307e\u3057\u3087\u3046\u3002","publisher":{"@id":"https:\/\/www.railscarma.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.railscarma.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.railscarma.com\/#organization","name":"\u30ec\u30fc\u30eb\u30ab\u30fc\u30de","url":"https:\/\/www.railscarma.com\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png","contentUrl":"https:\/\/www.railscarma.com\/wp-content\/uploads\/2020\/08\/railscarma_logo.png","width":200,"height":46,"caption":"RailsCarma"},"image":{"@id":"https:\/\/www.railscarma.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RailsCarma\/","https:\/\/x.com\/railscarma","https:\/\/www.linkedin.com\/company\/railscarma\/","https:\/\/myspace.com\/railscarma","https:\/\/in.pinterest.com\/railscarma\/","https:\/\/www.youtube.com\/channel\/UCx3Wil-aAnDARuatTEyMdpg"]},{"@type":"Person","@id":"https:\/\/www.railscarma.com\/#\/schema\/person\/1aa0357392b349082303e8222c35c30c","name":"\u30cb\u30ad\u30eb","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.railscarma.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/054f31ff35e9917aaf631b8025ef679d42dd21792012d451763138d66d02a4c0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/054f31ff35e9917aaf631b8025ef679d42dd21792012d451763138d66d02a4c0?s=96&d=mm&r=g","caption":"Nikhil"},"sameAs":["https:\/\/www.railscarma.com\/hire-ruby-on-rails-developer\/"]}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/posts\/41669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/comments?post=41669"}],"version-history":[{"count":7,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/posts\/41669\/revisions"}],"predecessor-version":[{"id":41676,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/posts\/41669\/revisions\/41676"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/media\/41677"}],"wp:attachment":[{"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/media?parent=41669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/categories?post=41669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.railscarma.com\/ja\/wp-json\/wp\/v2\/tags?post=41669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}