Giter Club home page Giter Club logo

c1000k-servers's Introduction

This project implements seven high performance websocket servers. It contains:

And it also contains one client to test those servers.

I have test them on AWS servers. One C3.4xlarge as the websocket server and two C3.2xlarge servers as clients. Basically servers use 12G memory and each client uses 1G memory. I have tuned those servers to support more than 1,000,000 connections. For example, add the below lines into /etc/sysctl.conf

fs.file-max = 9999999 
fs.nr_open = 9999999  
net.ipv4.ip_local_port_range = 1024 65535

Each client can create 60000 connections (<65535) on each IP so you should create multiple IP addresses on one AWS for clients. I have created 10 virtual internal IP addresses on each client.

Servers will send one message per minutes to all 1,200,000 connections. Each message only contains current time of this server. Clients can output metrics to monitor. Currently servers only use one thread to send messages to all websockets. If we use multiple threads to send, maybe we can get higher performance.

In one word, it is feasible to achieve 1,000,000 connections on popular frameworks.

Run sbt clean dist to compile and package projects.

c1000k-servers's People

Contributors

smallnest avatar

Watchers

 avatar  avatar  avatar

Forkers

goldhadoop

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.