Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在使用 PaddleHub 搭建 OCR 服务的时候发现一个问题,在开启"use_multiprocess"的情况下,由于采用了"Gunicorn",其默认超时时间比较短,在进行多张图片识别的时候服务器经常报超时错误([CRITICAL] WORKER TIMEOUT)
所以添加了设置"timeout"参数的功能,
可以通过命令行 --timeout 或者 -t 赋值,默认为300秒,当值为0就表示禁用超时设置.如:
hub serving start -m ocr_system --use_multiprocess --workers --timeout 0
也可以在"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
}