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
めぐろLT#6 怖い話 サーバーが次々死んでいく
Search
kiyoshi yamashita
August 31, 2023
Programming
240
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
めぐろLT#6 怖い話 サーバーが次々死んでいく
めぐろLTでの登壇資料
https://meguro-lt.connpass.com/event/288484/
kiyoshi yamashita
August 31, 2023
More Decks by kiyoshi yamashita
See All by kiyoshi yamashita
ユニットテスト環境改善/improve-unit-test-environment
ky6yk
0
490
画像のバリデーションはファイルサイズチェックだけでいいと思ってない?
ky6yk
0
570
ES2021/2022
ky6yk
0
66
Other Decks in Programming
See All in Programming
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.4k
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
120
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
120
残高管理から台帳サービスへの進化
artoy
0
180
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
200
Agents on Rails - Rails at Scale 2026
irinanazarova
0
520
パーソナライズPodcastを作った話
repunit11
0
130
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
900
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
450
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8k
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
310
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
160
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
560
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
400
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
730
Docker and Python
trallard
47
4.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
450
Mind Mapping
helmedeiros
1
400
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Exploring anti-patterns in Rails
aemeredith
4
530
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
580
The Language of Interfaces
destraynor
162
27k
Product Roadmaps are Hard
iamctodd
55
13k
Transcript
サーバーが次々死んでいく... 株式会社ラクーンHD yamashita.kiyoshi
まずは自己紹介 名前:山下 清史 所属:株式会社ラクーンホールディングス 技術戦略部 開発チーム 主な仕事:BtoB卸売りサイト スーパーデリバリーの開発
APサーバーをDocker化した - 今までのサーバーのセットアップは手作業でやっていた - Dockerfileにサーバーの設定をかける - 開発環境構築が楽になった - ログフォーマットをjsonにした -
ログを標準出力に出すようにした - サーバにsshしてログファイルを確認しなくてよくなった - fluentd -> Elasticsesarch -> kibanaでログを確認できる
進め方 - Dockerfileなどを作成する - ログをモダンにする - 不要なログを削除し、標準出力に出す - セキュリティ対策 -
機密情報をDockerfileに書かないようにした - ひたすらテスト 俺、このプロジェクトが終わったら長期休暇を取って海外旅行へ行くんだ... APサーバーをDocker化した
開発は上手くいった そして本番稼働して、初めの1、2日は上手く動いていた APサーバーをDocker化した
サーバーが死んでいく いきなりサーバーが死んでサービスサイトに繋がらなくなった アクセスログは全て500 会員が商品を購入できなくなった
サーバーが死んでいく 大量の同時アクセスが来ていたようだ…
一時的な高負荷によりメモリが足りなくなった? →メモリ割り当てを増やした 負荷テストが足りなかったなぁ~ 考えられる原因
メモリを2倍割り当てたはずなのにサーバーがまた死んだ... 対策した結果
パフォーマンス劣化のたびに対処療法(メモリ割り当てを増やす)を行った しかし、ついにアクセスが少ないときにサーバーが死んだ… 一時的な高負荷が問題じゃなかった… それでもまた…
計測 現在のアプリケーションサーバーにおいてヒープ領域の使用状況を確認すると 異常にメモリを使っているクラスが見つかった... そのクラスを確認したら
進め方 - Dockerfileなどを作成する - ログをモダンにする - 不要なログを削除し、標準出力に出す - セキュリティ対策 -
機密情報をDockerfileに書かないようにした - ひたすらテスト このプロジェクトが終わったら長期休暇を取って海外旅行へ行くんだ・・・ APサーバーをDocker化した
原因 不要なログ削除時の対応がミスっていたことが発覚した 対応ミスしたログの動作 - ログ出力前に、スレッド変数内にデータをためる - ログ出力後にデータをクリアする データをためるところを消さずにデータをクリアするコードのみを消していた
→メモリリーク発生
原因 gitでコミットした人を見ると...私でした
まとめ - 推測するな、計測せよ!! - メモリリークは気付きづらくて怖い - 解決までに時間がかかってしまった