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
Laravel Queue と仲良くなろう
Search
Satoshi Nishino
February 04, 2026
Programming
68
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Laravel Queue と仲良くなろう
2026/02/04 Fukuoka.php++ Vol.1 登壇資料
Satoshi Nishino
February 04, 2026
More Decks by Satoshi Nishino
See All by Satoshi Nishino
ガーデニングによる継続的バージョンアップ
fingerease
0
9
初めての個人開発で得た学び
fingerease
0
86
Other Decks in Programming
See All in Programming
Workers Cache を知る
syumai
0
370
残高管理から台帳サービスへの進化
artoy
1
200
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
800
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
180
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
ActionController meets Protocol Buffers
sorah
0
560
Performance Optimization With LLMs
xleitix
0
140
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
170
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
The untapped power of vector embeddings
frankvandijk
2
1.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
A designer walks into a library…
pauljervisheath
211
25k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Test your architecture with Archunit
thirion
2
2.4k
Crafting Experiences
bethany
1
380
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Accessibility Awareness
sabderemane
1
250
Building Adaptive Systems
keathley
44
3.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Transcript
Laravel Queueと仲良くなろう 2026/02/04 Fukuoka.php++ Vol.1
キューを利用する場面 - 計算量の多い処理 - 遅延実行が必要な処理 - LLMを利用した処理 - …etc 一方で、キューにはワーカープロセスの常駐が必要になるため、
実行タイミングが明確なスケジュール駆動の場合はリソース効率が悪くなる ※ただし、失敗時のリトライ処理のためにあえてキューを利用する場合もある = 実行タイミングが不明なイベント駆動での利用に適している
実際の起動コマンド
--timeout 起動オプションでのデフォルト値は7200としていたが、 もっと短くても良さそう(ジョブごとに設定している場合もあります) ジョブの処理に不具合があった場合にタイムアウトまで待たされる場合があり、 長いことによってキューが詰まる原因になる backoff, triesも必要に応じてジョブ側で個別に設定
--queue ジョブに優先度をつけられるので便利。 ex. - ユーザーによる予約実行処理(時間の厳密さが必要): high - ユーザーによる予約実行処理(時間の厳密さが不要): default -
ユーザーによるデータ更新のCRM連携: low
ワーカー数 少なすぎるとキューが詰まりやすくなるので、 ジョブごとの実行時間・積まれているジョブ数を監視しつつ調整すべき 弊サービスでは3にしてます
キューワーカーの起動方式 - queue:listen - コードの更新を手動でのプロセス再起動なしで適用できる - 開発環境での利用に適している - パフォーマンス❌ -
queue:work - 常駐プロセスのため、変更後はキューワーカーの再起動が必要 - 本番環境での利用に適している - パフォーマンス⭕ - 弊サービスでは以前はqueue:listenで起動していたため、queue:workへの切り替えを行った - 開発環境では --max-jobs=1 にすることで、擬似的にqueue:listenにしました
CPU使用率の変化
とあるバッチ処理の実行時間変化 Before After
ジョブ実装で便利なテクニック
shouldBeUnique
ジョブのバッチ実行
ジョブのバッチ実行 複数のジョブをバルク実行してその結果を通知とかする場合に便利そう (次の機能開発で使ってみることを検討中)
onQueue こっちより
onQueue こっちの方がいいね
ご清聴ありがとうございました Xやってます @fingerEase24