Giter Club home page Giter Club logo

websocket_agent's Introduction

websocket_agency

this can receive websocket from one client then connect to a server by tcp , then transfer msg between the two.

usage: websocket_transfer_tcp 8888 0.0.0.0:8889

测试数据

机器性能: 4核 3G内存 测试时go的版本为1.5.1

1W连接, 6W+ /s 读写次数, 4核, si在45% 左右, (每秒有10个左右的连接会等到接受超过2S) 增加到1W5连接, 还是6W/s 读写次数 si有到70% 左右 (每秒40个所有的连接会等到超过2S, 偶尔会3S)

每个连接改成1S发一条消息 1W连接没有任何压力, 1W/s的读写速度, 20%左右的si 1W5 si最高的20%左右

初始最高连接在2W8左右, 所以后边比较困难进行连接

可以修改 vi /etc/sysctl.conf

添加下面一行:

net.ipv4.ip_local_port_range = 1024 65535

sysctl -p

Linux默认的可用端口范围是: 32768-61000

引用 [root@PerfTestApp3 ~]# sysctl -a|grep ip_local_port_range net.ipv4.ip_local_port_range = 32768 61000

将默认端口修改为1024-65535

这样就会使得默认可用端口为1024-65535

替换之后再次进行测试 每个连接1S发送一条数据, 读写为6W/s si有到70% 左右 (每秒30个所有的连接会等到超过2S)

websocket_agent's People

Contributors

zxb19890727 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.