Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
APMをインストールしただけで動かしてない?
Search
demuyan
December 21, 2025
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
APMをインストールしただけで動かしてない?
demuyan
December 21, 2025
More Decks by demuyan
See All by demuyan
エンターテイメント業界で利用されるAWS
demuyan
0
670
AWS marketplaceでお手軽サーバ構築
demuyan
0
84
本のお題の決め方 / How to Choose a Better Theme for Your Book
demuyan
0
80
できる! ART
demuyan
6
5.4k
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.6k
Scaling GitHub
holman
464
140k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
How STYLIGHT went responsive
nonsquared
100
6.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Skip the Path - Find Your Career Trail
mkilby
1
240
Building Adaptive Systems
keathley
44
3.2k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
260
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
450
Navigating Team Friction
lara
192
16k
Transcript
APMをインストー ルしただけで動か してない? 低スペックなサーバーでもAPMを活用するた めの軽量化術 クラスメソッド 出村 成和
自己紹介 • 出村 成和(Demura Narikazu) • クラスメソッド ゲームソリューション部 こんな人です •
ITエンジニア • インフラ・New Relic技術サポート・アプリ開発 etc… • 前職ではソーシャルゲーム(バックエンド)開 発してました • New Relic Trailblazer
APMを入れたら「重く」なった!? • ある現場での悲劇: • APMをインストールした途端、本番環境のレ スポンスが悪化 • パフォーマンス調査のためのツールなのに CPUを食いつぶす •
正確に計測できない… • 結論: • 諦めないで! カスタマイズで軽くできます! 今回はPHP Agentを例に解説(他言語も考え方 は同じ)
なぜ重い? デフォルトは「全部盛り」 • 初期設定の正体 • すべてのデータを取得 • すべてのセグメントを記録 • すべてのSQLトレース
• すべてのイベント収集 → そりゃ重くもなる! (ヤサイニンニクアブラカラメ)
安心してください、調整できます • newrelic.ini ファイルで設定変更が可能 • ここでは効果の大きい「3つの調整ポイン ト」を紹介します
調整ポイント① セグメント上限 • 後から調査するために保存するデータの「量」を制限する • セグメントとは • 関数呼び出しなどの処理の最小単位 • 設定箇所:
• newrelic.transaction_tracer.max_segments_web = 0 • Web: 通常は制限なし(0)でOK。1つの処理自体が長時間かかる場合は制限する • newrelic.transaction_tracer.max_segments_cli = 100000 • CLI: デフォルト(10万)でも重ければ、さらに減らす。
調整ポイント② SQL監視 • SQL監視の負荷を下げる • EXPLAIN(実行計画)の罠: • 遅いクエリ発見 → 調査用にもう一度似たクエリ
を実行 • つまり2回走る = 重い! • 設定: • newrelic.transaction_tracer.explain_enabled = true • 対策: • 頻繁に重いクエリが走るシステムならOFFを検討
調整ポイント③ 収集詳細度 • トレースとは • 1つのリクエスト処理の開始から終了までの詳 細な追跡記録 • トレース詳細度: •
newrelic.transaction_tracer.detail = 1 • デフォルト(1): すべて記録 • 最小限(0): 必要最小限 • 戦略: • 詳細に追いかけたい → 詳しく (1) • ざっくりな内容でも問題ない → 軽く (0)
実務でのステップ 1. APMをインストール、デフォルトで動かす 2. CPU負荷を確認(目安:5%まではOK、10% 超えなら対策) 3. ターゲットを絞る 1. DB負荷が高い?
→ SQL監視を制限 2. コード処理が重い? → セグメントを制限 問題ある箇所は詳しく、ない箇所は軽く
もっと詳しく知りたい方へ • 公式ドキュメント “PHP agent overhead reduction tips” も読むとよい •
技術同人誌 『New Relicに詳しい人達が書 いた本』 • 第1章『初期設定から一歩先へ、APMの詳細 設定ガイド』にはより詳細に書かれています • かってね!
• APMを活用して快適な可観測ライフを! • ご清聴ありがとうございました