-
Notifications
You must be signed in to change notification settings - Fork 2.5k
运行教程中的parallel_wget遇到错误ERROR! state = 1, error = 11
#135
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
Comments
这个简单。state == SYS_ERROR, error = EAGAIN。说明没有连接可以用了。改一下global settings,把max_connections改到1000以上。这个值默认为200 |
struct WFGlobalSettings settings = GLOBAL_SETTINGS_DEFAULT; |
这个参数指的是对单个ip:port的最大并发连接数,所以其实很少需要太大。 |
补充一点,http server端模拟慢请求,不要在process里调用sleep函数,最好使用定时器任务: void process(WFHttpTask *server_task)
{
server_task->get_resp()->append_output_body(“Hello World!”);
series_of(server_task)->push_back(WFTaskFactory::create_timer_task(5*1000*1000, nullptr));
} 以上代码实现一个延迟5秒返回的http server。等待时间不占用线程。 |
十分感谢。解决了问题。 @Barenboim |
Experiment code here: https://github.com/chanchann/workflow_annotation/tree/main/demos/08_max_con |
背景
修改了一下
tutorial-06-parallel_wget.cc
的源码,同时发起1000个http请求(每个请求等待5秒后简单的返回hello world),前面的请求正常返回,后面的请求遇到了ERROR! state = 1, error = 11
的错误。在http服务里记录了请求数量,发现实际只有200个请求,似乎在哪里有请求数量限制。
问题
想知道这个错误的意义是什么,这个200个请求的限制是http client带来的还是并行任务处理器带来的。
The text was updated successfully, but these errors were encountered: