04 2021 档案
摘要:1.poll io服务器(单线程处理所有请求) server.c #include <stdio.h> #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <errno.h> #include
阅读全文
摘要:linux系统默认ulimit为1024个访问 用户最多可开启的程序数目。一般一个端口(即一个进程)的最高连接为2的16次方65536 通过这个命令 ulimit -n 可以看到默认值为1024 查看全局文件句柄数限制(系统支持的最大值)cat /proc/sys/fs/file-max查看每个进程
阅读全文
摘要:使用apachebench进行测试,ubuntu 安装sudo apt-get install apache2-utils ,ab -n 2000000 -c 1000 -s 10 -k http://192.168.88.129:11111/ 1.不使用select机制,一个客户端创建一个线程。
阅读全文
摘要:1.介绍 有时候需要在服务器开发代码,常规的方法在服务器使用VIM工具开发,或者将服务器的代码复制一份到本地,修改完了就使用ftp工具替换服务器的文件,这样开发效率比较低。 可以使用VSCode的Remote-SSH插件,远程登录服务器打开服务器中相应的文件夹进行开发。 2.安装 目前Remote-
阅读全文
摘要:类似这种: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<const nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, st
阅读全文
摘要:(转)github地址:https://github.com/pymumu/tinylog# Tinylog Tinylog是一个UNIX环境下轻量级的C/C++高性能异步日志组件,其提供了高性能,异步,线程安全,进程安全的日志功能。 支持日志归档,支持多线程并发写日志,多进程并发写日志,支持非阻塞
阅读全文