應(yīng)該是msyql 連接長時間空閑斷開了。 你加個定時器,定時 'select 1',這樣定時和mysql通訊,保持連接不被關(guān)閉。定時間隔50秒差不多。
感謝回答,能詳細講講具體代碼是怎么樣的,要在哪里寫,我是小白,求詳解
寫在onWorkerStart里。
\Workerman\Lib\Timer::add(50, function(){ Db::query('select 1'); });
偽代碼大概這樣
感謝,決解了
還有點問題 Warning: system call select exceeded the maximum number of connections 256.
又出現(xiàn)了這種問題,連接數(shù)達到最大值Warning: system call select exceeded the maximum number of connections 256.
手冊說windows下workerman做多支持256個連接,裝event擴展吧,或者換linux系統(tǒng)
@1393:感謝回答,windows 下怎么安裝event擴展,感覺很難,linux 系統(tǒng)不好更換