国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

導(dǎo)出大量Exl數(shù)據(jù)報(bào)錯(cuò) nginx 502 Bad Gateway

TM

導(dǎo)出大量Exl數(shù)據(jù)報(bào)錯(cuò) nginx 502 Bad Gateway

使用使用nginx代理webman 目前導(dǎo)出6W數(shù)據(jù)沒問題超出8W數(shù)據(jù)后則報(bào)錯(cuò)502

已經(jīng)給方法增加運(yùn)行時(shí)間和腳本運(yùn)行內(nèi)存,nginx錯(cuò)誤日志未記錄信息

   //導(dǎo)出
    public function exlCsv($queryResult, $heade)
    {
        ini_set('memory_limit', '800M');
        ini_set('max_execution_time', '500');
        //獲取頭部
        $headeList = $this->forHeader($heade);
        //獲取內(nèi)容
        $body = $this->forBody($queryResult);
        $headeList .= "\n" . $body;
        //下載csv的文件名
        $fileName = '公共導(dǎo)出' . date('Y-m-d H:i:s') . '.csv';
        //打開php數(shù)據(jù)輸入緩沖區(qū)
        ob_start();
        echo $headeList;
        $xlsData = ob_get_clean();
        $response = response();
        $response->header('Content-type', 'text/html;charset=utf-8');
        $response->header('Content-type', 'text/csv');
        $response->header('Content-Disposition', 'attachment;filename=' . $fileName);
        $response->header('Cache-Control', 'must-revalidate,post-check=0,pre-check=0');
        $response->header('Expires', '0');
        $response->header('Pragma', 'public');
        $response->header('Connection', 'Keep-Alive');
        $response->withBody($xlsData);
        return $response;
    }

報(bào)錯(cuò)信息

502 Bad Gateway
nginx

截圖報(bào)錯(cuò)信息里報(bào)錯(cuò)文件相關(guān)代碼

截圖

操作系統(tǒng)及workerman/webman等框架組件具體版本

webman版本
截圖

php版本號(hào) 運(yùn)行環(huán)境linux
截圖
代理配置
截圖

2174 4 1
4個(gè)回答

dadadas
  • TM 2023-01-19

    謝謝 我看看

keytehu

看rutime/logs下的日志,猜測(cè)導(dǎo)出數(shù)據(jù)太大,超出php的內(nèi)存限制了

  • TM 2023-01-19

    rutime 下面沒打印出報(bào)錯(cuò)日志呢,應(yīng)該不是內(nèi)存問題 我加到2048M都不行,導(dǎo)出執(zhí)行到1分30秒就斷開了不知道是php的腳本時(shí)間問題還是nginx時(shí)間問題,不過這兩個(gè)時(shí)間我都設(shè)置了300秒 但是腳本只跑了90秒就斷開了

又有心跳

不用nginx代理呢

  • TM 2023-01-19

    不用nginx代理可以,已處理,nginx代理修改配置沒生效,我之前是重載配置的,我重啟服務(wù)后可以了

liziyu

我記得php有個(gè)yield你度一下用法,可以解決吃內(nèi)存問題。

  • TM 2023-01-20

    迭代器嗎?

年代過于久遠(yuǎn),無法發(fā)表回答
??