PaddlePaddle / PaddleHub

Awesome pre-trained models toolkit based on PaddlePaddle. (400+ models including Image, Text, Audio, Video and Cross-Modal with Easy Inference & Serving)【安全加固,暂停交互,请耐心等待】
https://www.paddlepaddle.org.cn/hub
Apache License 2.0
12.74k stars 2.07k forks source link

添加设置 timeout 参数逻辑 #2262

Open caiiiac opened 1 year ago

caiiiac commented 1 year ago

在使用 PaddleHub 搭建 OCR 服务的时候发现一个问题,在开启"use_multiprocess"的情况下,由于采用了"Gunicorn",其默认超时时间比较短,在进行多张图片识别的时候服务器经常报超时错误([CRITICAL] WORKER TIMEOUT) 所以添加了设置"timeout"参数的功能,

  1. 可以通过命令行 --timeout 或者 -t 赋值,默认为300秒,当值为0就表示禁用超时设置.如: hub serving start -m ocr_system --use_multiprocess --workers --timeout 0

  2. 也可以在"config.json "中添加 { "modules_info": { "ocr_system": { "init_args": { "version": "1.0.0", "use_gpu": false }, "predict_args": { } } }, "port": 8868, "use_multiprocess": true, "workers": 2, "timeout": 0 }

CLAassistant commented 1 year ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

MyOnlyCat commented 1 year ago

感谢兄弟,才遇到这种超时问题