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
Laravel5でJob_Queue実装した話_v1.0.1
Search
NakanishiTetsuhiro
March 06, 2019
Technology
69
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Laravel5でJob_Queue実装した話_v1.0.1
修正版でございます
NakanishiTetsuhiro
March 06, 2019
More Decks by NakanishiTetsuhiro
See All by NakanishiTetsuhiro
コメントの書き方から見る 良いコードについての考察
nakanishitetsuhiro
0
700
SelfIntroduction
nakanishitetsuhiro
0
69
Laravelで設計する際の ベストプラクティスを探る
nakanishitetsuhiro
0
2.4k
MackerelでECS on Fargate 監視してみた
nakanishitetsuhiro
0
960
WebエンジニアによるWebエンジニアのための今だからこそおすすめしたいLinux環境
nakanishitetsuhiro
1
110
本番環境をECSで構築した話
nakanishitetsuhiro
0
940
Laravel5でjobque実装した話
nakanishitetsuhiro
0
120
社会人による社会人のための友達づくりのすゝめ
nakanishitetsuhiro
0
62
RancherにDocker初心者がチャレンジしてみた!.pdf
nakanishitetsuhiro
0
450
Other Decks in Technology
See All in Technology
Kiro IDE 入門 (画面の各部から、頼み方、任せ方、戻し方まで) | 目指せ Kiro マスター 02
inariku
PRO
4
170
AI時代に求められる優秀なTechLeadの振る舞い
pospome
11
15k
生成AI時代のIAMのマニアックな話
takuros
6
2.8k
レガシーコードに対する loop engineering的なAI開発プロセス導入について
kubell_hr
0
290
Kiro Crew 入門 (手を離しても進む仕事) | 目指せ Kiro マスター 11
inariku
PRO
4
650
自律的なチームを作るためにTechPMがやらないこと
ny7760
1
530
Active Directory と Entra ID のむむむな関係
murachiakira
PRO
4
1.7k
The future of architectural work
ufried
0
190
自治体AIコンタクトセンター、何をどこに任せる?~Amazon Connect Customer +Amazon Bedrockの実践知~ / 20261107 Satoshi Torano
shift_evolve
PRO
1
120
DBTS2026 盛り上がってますか!?Databricksが実現するAI時代のデータ基盤
akuwano
1
200
re:Invent2026 事前勉強会 歴史と愉しみ方10分LT編
toshi_atsumi
0
170
IBC 2026 動画技術関連レポート / IBC 2026 Report
cyberagentdevelopers
PRO
2
450
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
610
The agentic SEO stack - context over prompts
schlessera
0
1k
Side Projects
sachag
456
43k
First, design no harm
axbom
PRO
2
1.4k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
600
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
390
Transcript
Laravel5Ͱ Job/Queue࣮ͨ͠ גࣜձࣾRe:Build ͯͭ (Twitter: @kaoru6strings) 20193݄4ʢਫʣ Larval Meetup Okinawa
#08 https://laravel-meetup-okinawa.connpass.com/event/122396/
ࣗݾհ • த େʢͯͭ͞Μ or ͯͬͪΌΜʣ • גࣜձࣾRe:BuildɿWebΤϯδχΞ • ϦϞʔτϫʔΫͯ͠·͢
• Laravel + Vue.js, Ruby on rails @kaoru6strings
ຊJob/Queueͷ͓ @kaoru6strings
ॏ͍ॲཧผϓϩηεͰ ಈ͔͢บΛ͚ͭͯ LaravelྗΛΞοϓ͠Α͏ʂ @kaoru6strings
Job/Queueͷ͍ॴ • ϝʔϧૹ৴ • Ϣʔβͷಋઢʹؔͷͳ͍ॏ͍ͨॲཧ • ฒྻ࣮ߦ͕ඞཁͳόονॲཧ @kaoru6strings
Ϣʔβʔ͕ϒϥβ͔ΒҙͷλΠϛϯάͰ όονΛ࣮ߦ͢Δ߹ Ϣʔβͷಋઢ ͱͳΔϓϩηε @kaoru6strings ϫʔΧʔ
όονॲཧͷJobΛΩϡʔʹೖ Queue +PC +PC +PC +PC +PC
ࣄલ४උ̍ • app/Console/Kernel.phpͷscheduleʹԼهΛ Ճ • $schedule->command('queue:work --tries=1 -- timeout=0’)->withoutOverlapping(); @kaoru6strings
ࣄલ४උ̎ • crontab -e ͰԼهΛՃ • * * * *
* php /var/www/project_name/artisan schedule:run >> / dev/null 2>&1 • php artisan make:job ProcessSomething Ͱ ੜͨ͠ app/jobs/ProcessSomething.phpʹ ॲཧΛՃ @kaoru6strings
ࣄલ४උ̏ • LaravelϓϩδΣΫτͷ͓͖ͳॴʹԼهͷ ίϚϯυΛॻ͍ͯɺqueʹjobΛՃ • ProcessSomething::dispatch(); @kaoru6strings
͔͜͜Β͕ϋϚͬͨ ϙΠϯτͷհ @kaoru6strings
ࣄҊ̍: Τϥʔϩά͕ग़ྗ͞Εͳ͍ • /storage/logs/laravel.log ͷॻ͖ࠐΈݖݶΛ nginxϢʔβͷΈ͕อ͍࣋ͯͨͨ͠Ίɺϫʔ ΧʔΛ࣮ߦ͍ͯ͠ΔϢʔβ͕ΤϥʔϩάΛॻ ͖ࠐΊͣʹ͍ͨ • setfacl
-Rdm u::rwx,g::rwx,o::rwx storage @kaoru6strings
ࣄҊ̎: ্ཱͪ͛ͨϫʔΧʔ͕ͩ Μ·Γಥવࢮ͢Δ • Laravel, phpͷϩάʹԿग़ྗ͞Εͳ͍ @kaoru6strings
্ཱͪ͛ͨϫʔΧʔ͕ͩΜ·Γ ಥવࢮ͢Δ • λΠϜΞτ͍ͯ͠Δͷ͕ݪҼͩͬͨΈ͍ͨ • ϫʔΧʔ্ཱͪ͛࣌ͷίϚϯυʹԼهΦϓγϣ ϯΛࢦఆͯ͠λΠϜΞτ͠ͳ͍Α͏ʹͨ͠ • - -timeout=0
@kaoru6strings https://stackoverflow.com/questions/25877752/laravel-queue-process-timeout-error
Tips @kaoru6strings
ϫʔΧʔ͕ਖ਼ৗʹ͕͍ͨͪ͋ͬͯΔ͔֬ೝ͍ͨ͠ • ps -aef | fgrep php @kaoru6strings
ςετڥͰϫʔΧʔͷॲཧ͕ʂʂ • ·ͣਂݺٵ • ps -aef | fgrep php ͰϓϩηεidΛ֬ೝͨ͠Β
3024൪ͩͬͨ • Kill -9 3024 @kaoru6strings
Laravelͷ.envͰQUEUE_DRIVERΛઃఆ͢Δํ ๏Ͱjobͷཧํ๏ΛมߋͰ͖Δ • QUEUE_DRIVER=sync • ςετ༻ • QUEUE_DRIVER=database • Laravel͕ར༻͍ͯ͠ΔDBͰҰॹʹjobΛཧ
• QUEUE_DRIVER=redis • RedisͰjobΛཧ @kaoru6strings
վળɾٙ • ࠓճKernelʹίϚϯυΛՃͯ͠ϫʔΧʔ Λىಈͤ͞Δํ๏Λͱ͕ͬͨɺຊ SupervisorΛઃఆͨ͠΄͏͕͍͍Β͍͠ • Laravel forge(https://forge.laravel.com/)Λ ͬͨΒઃఆ͕؆୯Β͍͚͠Ͳɺͬͨ͜ ͱ͋Δਓ͍·͔͢ʁ
@kaoru6strings
ΈΜͳͰJob/Queue͓͏ʂ @kaoru6strings
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ @kaoru6strings