第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Laravel 查詢?nèi)罩局写嬖诖罅孔鳂I(yè)查詢是否可以?

Laravel 查詢?nèi)罩局写嬖诖罅孔鳂I(yè)查詢是否可以?

PHP
慕森王 2023-09-15 17:45:25
最近,我們的 Laravel 查詢?nèi)罩咀兊妹黠@更大。每天約為 50-100mb,一天后增加到約 1-1.5gb。有很多對(duì)jobs表的查詢,像這樣[05.08.2020 00:00:02] select * from `jobs` where `queue` = ? and ((`reserved_at` is null and `available_at` <= ?) or (`reserved_at` <= ?)) order by `id` asc limit 1 for update [default, 1596574802, 1596571202][05.08.2020 00:00:05] select * from `jobs` where `queue` = ? and ((`reserved_at` is null and `available_at` <= ?) or (`reserved_at` <= ?)) order by `id` asc limit 1 for update [default, 1596574805, 1596571205][05.08.2020 00:00:09] select * from `jobs` where `queue` = ? and ((`reserved_at` is null and `available_at` <= ?) or (`reserved_at` <= ?)) order by `id` asc limit 1 for update [default, 1596574809, 1596571209][05.08.2020 00:00:12] select * from `jobs` where `queue` = ? and ((`reserved_at` is null and `available_at` <= ?) or (`reserved_at` <= ?)) order by `id` asc limit 1 for update [default, 1596574812, 1596571212][05.08.2020 00:00:15] select * from `jobs` where `queue` = ? and ((`reserved_at` is null and `available_at` <= ?) or (`reserved_at` <= ?)) order by `id` asc limit 1 for update [default, 1596574815, 1596571215][05.08.2020 00:00:18] select * from `jobs` where `queue` = ? and ((`reserved_at` is null and `available_at` <= ?) or (`reserved_at` <= ?)) order by `id` asc limit 1 for update [default, 1596574818, 1596571218][05.08.2020 00:00:21] select * from `jobs` where `queue` = ? and ((`reserved_at` is null and `available_at` <= ?) or (`reserved_at` <= ?)) order by `id` asc limit 1 for update [default, 1596574821, 1596571221]他們整天都在這樣詢問。我怎樣才能減少這個(gè)金額?或者有那么多疑問可以嗎jobs?
查看完整描述

1 回答

?
郎朗坤

TA貢獻(xiàn)1921條經(jīng)驗(yàn) 獲得超9個(gè)贊

是的,如果您有積壓的工作需要幾秒鐘才能完成,這似乎很正常。

來自文檔:

當(dāng)隊(duì)列中有可用作業(yè)時(shí),工作人員將繼續(xù)處理作業(yè),作業(yè)之間不會(huì)有任何延遲。但是,該sleep選項(xiàng)確定如果沒有新的工作可用,工作人員將“睡眠”多長(zhǎng)時(shí)間(以秒為單位)。睡眠期間,worker 不會(huì)處理任何新作業(yè) - 這些作業(yè)將在worker 再次醒來后處理。

https://laravel.com/docs/7.x/queues#job-expirations-and-timeouts

因此,在您的示例中,隊(duì)列工作線程有積壓的作業(yè)需要處理,并且在每個(gè)完成的作業(yè)后立即獲取下一個(gè)作業(yè)。


查看完整回答
反對(duì) 回復(fù) 2023-09-15
  • 1 回答
  • 0 關(guān)注
  • 98 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)