サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
GPT-4o
scoutapm.com
ネイト・ベルコペック (@nateberkopec) SpeedShop(詳細),Railsパフォーマンス・コンサルタンシー 要約:Rails開発者の多くが、ActiveRecordがSQLクエリを実際に実行する条件を理解していません。よくある3つのケースを見てみましょう:countメソッドの誤使用と、サブセットをセレクトするためのwhereの使用、そしてpresent?です。 断言しましょう。あなたはこの3つのメソッドを使い過ぎていて、無駄なQueryとN+1を発生させているでしょう。 (字幕:なんて奇妙な謎だ、バットマン!) "いつActiveRecordがクエリを実行するかって?知るか!" ActiveRecordは素晴らしいです。本当に。しかし抽象化されているので、データ・ベース上で実行されている実際のSQLクエリに無頓着になりがちです。ActiveRecordがどのように動作す
すでにLinuxのロード・アベレージのことを、よくご存知かもしれません。ロード・アベレージはuptimeとtopコマンドで表示される3つの数字です。下のように表示されます。 大多数の人は多かれ少なかれ、ロード・アベレージとは何かを知っているでしょう。 3つの数字は、段階的な期間(1分、5分、15分の平均)での平均を表しています。数字が小さいほど良いことを示しています。大きい数字は、何か問題があるか、マシンの過負荷を意味します。しかし、しきい値は何でしょう?どんな時にロード・アベレージを気にしなければならないのでしょうか、そして、どんな時に緊急で、できるだけ早く解決するべきなのでしょうか? 最初にロード・アベレージの意味について簡単に背景を説明します。最も簡単な例から始めましょう:一台のマシンに、シングル・コアのプロセッサが搭載されている場合です。 トラフィックの例え シングル・コアのCPU
This article was written by a contributor special to Scout APM. Ruby on Rails view partials can help keep your codebase DRY (Don’t Repeat Yourself) but misusing them can have a significant performance impact. In this blog post, I’ll describe when you should avoid using view partials and the alternatives. Measuring The Performance Impact Let’s start by checking how much slower your app could be whe
Rubyのアプリケーションサーバーのエコシステムは、Unicorn、Puma、Passenger 5 の3つを中心に出来上がっています。Rubyにおいて、アプリケーションサーバーが解決しなければならない具体的な問題はなんでしょうか。どのようにして最適なアプリケーションサーバーを選択すればよいでしょうか。2019年にはこれらのアプリケーションサーバーのニーズはあるでしょうか。 この記事ではこら全てを取り上げ、Rubyの主要なアプリケーションサーバーを比較していきます。 How important is an app server's raw speed? アプリケーションサーバーそのものの速度がアプリケーションの速度に対して多くの要因となることはほとんどありません。アプリケーションコード、データベースのクエリ、HTTPコールのRubyアプリケーションサーバーとの間の応答速度が、マイクロ秒ない
ネイト・ベルコペック (@nateberkopec) SpeedShop(詳細),Railsパフォーマンス・コンサルタンシー 要約:Rubyアプリケーションのための”スケーリング”についての情報は、毎秒数百リクエストを処理している企業によって書かれたものがほとんどです。そうではない私たちのためのスケーリングはどのようなものでしょうか? スケーリングは敷居の高いトピックです。Rubyアプリケーションのスケーリングに関するブログやインターネットでの情報のほとんどは、毎分何万ものリクエストへのスケーリングについて書かれたものです。TwitterやShopifyの規模です。興味深いですが...Rubyでどれくらいできるか、上限を知ることはいいことです...1台よりは多いものの、せいぜい100台以下のサーバでアプリケーションを実行している、私たちのような大多数にとってはあまり役に立ちません。スケー
Looking for a fresh, 2018 approach to deploying a Rails app to AWS? We've partnered with DailyDrip on a series of videos to guide you through the process. We're covering how to Dockerize a Rails app, AWS Fargate, logging, application performance monitoring, setting up load balancing, SSL, CDN, and more. In today's video, we're setting up a background job server for our Rails app. There are several
What's the 2018 approach to deploying a Rails app to AWS? We've partnered with DailyDrip on a series of videos to guide you through the process. We'll be covering how to Dockerize a Rails app, AWS Fargate, logging, monitoring, and CDN support. Today, we will be working through a few steps to get our app Dockerized and our image pushed to a hosted Docker registry. Introduction to Docker Docker is a
It's a lot harder connecting the dots of the request lifecycle when the final response is built from a number of separate microservices. However, distributed tracing - which connects a transaction trace across microservices - is getting a lot easier. In this short tutorial, I'll show how to add distributed tracing to your Sinatra web apps via OpenTracing, a vendor-neutral tracing API, and Jaeger,
What's the 2018 approach to deploying a Rails app to AWS? We've partnered with DailyDrip on a series of videos to guide you through the process. We'll be covering how to Dockerize a Rails app, AWS Fargate, logging, monitoring, and CDN support. Today's video is the next in the series of setting up our produciton app for production use in AWS ECS. In our last video, we Dockerized the app to prepare
Your Rails app appears to be humming along just fine. But then, out of the blue, one of your most important customers emails your support team: "the site is loading slowly - is something up"? You frantically browse around the site, but everything seems fine. You double-check the charts: things look normal. Is the customer trying to trick you? Is monitoring broken? In this post, I'll show how to sl
Can includes prevent N+1 queries? Yes. includes will load (1) all records of the parent and (2) all of the records referenced as arguments in the includes method. Notice how using includes in the example below only triggers 1 additional query. Without includes, there would be an additional query to count the number of comments for every post: Post.includes(:comments).map { |post| post.comments.siz
Rails::API was released in the spring of 2012. Rails::API loads a subset of the Rails stack for apps that only generate JSON content, skipping out on middlewares that don't apply to API apps (examples: cookie, flash, and session management). Rails::API started as a stand-alone gem, but with the release of Rails 5 in the summer of 2016, its now included by default in Rails. The rest There are other
Updated version of an article first published on February 10th, 2017. The Ruby app server ecosystem has consolidated around three app servers: Unicorn, Puma, and Passenger 5. What specific problems must an app server solve for Ruby? How do you pick the right app server? Is there a need for each of these app servers in 2021? In this post, we'll cover all of the above, as well as compare and contras
Are folks upgrading to Rails 5? Where is the Postgres vs. MySQL battle heading? Are devs embracing Puma and concurrency? If you're curious about the above, you've come to the right place. We collect gems used on the apps we monitor at Scout to assist with debugging issues and to prioritize libraries we want to instrument. This data set, which is across thousands of apps, should be enough to grab g
The holy grail of performance profiling is finding a tool that's safe to run in production. A tool that identifies slow code as it works "in the wild". Profiling code locally is never as good as production profiling: the load is small, hardware specs are different, and I'd need to pull down a huge chunk of data to simulate things. Enter StackProf, the production safe*, holy grail of Ruby profiling
The Linux kernel is an incredible circus performer, carefully juggling many processes and their resource needs to keep your server humming along. The kernel is also all about equity: when there is competition for resources, the kernel tries to distribute those resources fairly. However, what if you've got an important process that needs priority? What about a low-priority process? Or what about li
If I was teaching Server Health 101, I'd start with four key metrics: CPU Usage Memory Usage Network I/O Disk Utilization The approach for fetching these metrics on Linux hosts is tried-and-true (hint: look in the /proc folder). However, I was curious about Docker Containers: where do I access these critical metrics? What tools does Docker provide? Are there any gotchas? Read on for what I found.
Updated version of an article first published on February 24th, 2015. Your Linux server is running slow, so you follow standard procedure and run top. You see the CPU metrics: But what do all of those 2-letter abbreviations mean? The 3 CPU states Let's take a step back. There are 3 general states your CPU can be in: Idle, which means it has nothing to do. Running a user space program, like a comma
I've been hearing how Docker is the new awesome, but it didn't click for me until I dug in with a practical question: if we deployed Scout via Docker, would deployment be a more pleasurable experience? My three takeaways are below. Finally, an efficient way to simulate our production environment Our production environment has 16 servers. If I attempted to simulate this locally with VirtualBox's re
A big thanks to Eric Lindvall of Papertrail for adding steal time to Scout's CPU Usage Plugin and helping out on this blog post! Netflix tracks CPU Steal Time closely. In fact, if steal time exceeds their chosen threshold, they shut down the virtual machine and restart on a different physical server. If you deploy to a virtualized environment (for example, Amazon EC2), steal time is a metric you'l
Updated version of an article first published on February 10th, 2011. If you’re old enough to remember floppy drives, you’ve heard the symptoms of a disk I/O bottleneck. For example, while Oregon Trail loaded the next scene, you’d hear the drive grinding away, reading data from the disk. The CPU would sit idle during this time, twiddling its fingers waiting for data. If that floppy drive was faste
When checking the amount of free memory on a Linux server, it’s easy to think you’re running out of memory when you’re not. For example, here’s the output of free -m on a server with 4GB of RAM: With a quick glance, you might start sweating. Only 39 MB of free memory? Put down the antacid – you’ve got a lot more free memory than you think. Memory Caching & Buffers Reading data from a disk is far s
Most people have an inkling of what the load averages mean: the three numbers represent averages over progressively longer periods of time (one, five, and fifteen-minute averages), and that lower numbers are better. Higher numbers represent a problem or an overloaded machine. But, what's the threshold? What constitutes "good" and "bad" load average values? When should you be concerned over a load
Deep performance analysis and transaction traces for Ruby apps
Say your Rails application is running in production and it’s getting good traffic. Performance isn’t as good you would like. You’ve already determined that your database is not the bottleneck. What’s your next move? There is a good chance that PassengerMaxPoolSize to be adjusted. PassengerMaxPoolSize specifies how many instances of your application Passenger will spin up to service incoming reques
Life as a cross-dresser must be unnerving. I could buy a wig, put some makeup on my adam’s apple. Buy a skirt. Does a sock-filled bra work for my bosom? With a bit of mood lighting, I might actually look like a woman, but it would be difficult to relax. Knowing my manhood could be exposed in a multitude of ways – some stubble on my chin, hair on my legs, forgetting to make my voice less deep, etc.
Dr. Brendan Reilly instituted a simple test to determine whether a patient was suffering from a heart attack. It combined just 4 questions with the results of an ECG. This simple test was 70% better than the barrage of questions previously asked by hospital staff to identify patients that weren’t having a heart attack and was nearly 20% better at identifying patients that were having heart attacks
このページを最初にブックマークしてみませんか?
『Application Monitoring for Ruby, PHP, Node.js, Python, and Elixir ~ Scout』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く