摘要: 1.poll io服务器(单线程处理所有请求) server.c #include <stdio.h> #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <errno.h> #include 阅读全文
posted @ 2021-04-24 22:45 jest549 阅读(83) 评论(0) 推荐(0) 编辑
摘要: linux系统默认ulimit为1024个访问 用户最多可开启的程序数目。一般一个端口(即一个进程)的最高连接为2的16次方65536 通过这个命令 ulimit -n 可以看到默认值为1024 查看全局文件句柄数限制(系统支持的最大值)cat /proc/sys/fs/file-max查看每个进程 阅读全文
posted @ 2021-04-24 17:43 jest549 阅读(2918) 评论(0) 推荐(0) 编辑
摘要: 使用apachebench进行测试,ubuntu 安装sudo apt-get install apache2-utils ,ab -n 2000000 -c 1000 -s 10 -k http://192.168.88.129:11111/ 1.不使用select机制,一个客户端创建一个线程。 阅读全文
posted @ 2021-04-24 15:14 jest549 阅读(85) 评论(0) 推荐(0) 编辑