Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加设置 timeout 参数逻辑 #2262

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

caiiiac
Copy link

@caiiiac caiiiac commented Jun 6, 2023

在使用 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
Copy link

CLAassistant commented Jun 6, 2023

CLA assistant check
All committers have signed the CLA.

@MyOnlyCat
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants