Comments (6)
Experiment code here: https://github.com/chanchann/workflow_annotation/tree/main/demos/08_max_con
from workflow.
这个简单。state == SYS_ERROR, error = EAGAIN。说明没有连接可以用了。改一下global settings,把max_connections改到1000以上。这个值默认为200
from workflow.
struct WFGlobalSettings settings = GLOBAL_SETTINGS_DEFAULT;
settings.endpoint_params.max_connections = 1024;
WORKFLOW_library_init(&settings);
from workflow.
这个参数指的是对单个ip:port的最大并发连接数,所以其实很少需要太大。
from workflow.
补充一点,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。等待时间不占用线程。
from workflow.
十分感谢。解决了问题。 @Barenboim
from workflow.
Related Issues (20)
- 关于Executor调度算法的讨论 HOT 7
- 编译失败, undefined reference to `EVP_PKEY_CTX_set_rsa_padding' collect2: error: ld returned 1 exit status HOT 21
- 预期是 task1 -> gotasks(counter) -> counter -> task3 怎么编程了 counter(gotasks) 最前执行 HOT 2
- 实现一次redis写入与读出:redis_cli 编译的时候报错。 HOT 6
- 利用workflow 写了一个redis客户端程序,当传入的命令是brpop这种阻塞式命令后,redis server一段时间没数据返回就会报错 HOT 5
- 有个指针和引用问题,请教一下。 HOT 4
- C++语法问题请教一下。 HOT 2
- queue get HOT 3
- __poller_handle_listen, __poller_handle_read, __poller_handle_write等函数内部为什么都会有__poller_remove_node, 比如在__poller_handle_listen中的最后调用__poller_remove_node, 不就会把之前add进来的server fd删除了吗?
- 求一个基于 parallework 的 WFMysqlConnection demo HOT 1
- 关于redis-proxy 超时问题 HOT 8
- 关于会收到重复Http请求的问题 HOT 3
- workflow server能否在process中向另一个客户端创建http任务发送数据 还有对 workflow wait_group使用的问题 HOT 8
- 一个SeriesWork 使用上面的疑问 HOT 4
- 域名问题 HOT 5
- WFConditional可以加一个访问task的接口嘛 HOT 7
- http请求的body数据多了些内容? HOT 2
- Ubuntu23.04会有undefined reference to `SSL_ctrl'错误 HOT 4
- http server 如何将一个大文件分块传输给http client?
- why create_repeater_task doesnt work,what I miss here? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workflow.