Git Product home page Git Product logo

positionstreamserver's Introduction

Position Stream Server

CircleCI

3Dアバターの座標を多人数で共有するサーバー

  • 「体の座標」と「体のY軸周りの回転」と「頭の姿勢」を共有します。
  • 1500人程度まで共有が可能です。
  • 直近の100人だけ送信します。

通信量

X[MB/sec] = 48[byte] * N[人] * 100[人] * 30[fps] / 1000000[/MB]

依存SDK

ビルド

git clone [email protected]:MIKUEC2020/PositionStreamServer.git

cd StreamServer && dotnet build

実行

cd StreamServer && dotnet run

テスト

cd StreamServer.Test && dotnet test

トラブルシューティング

Socketバッファサイズ

1000接続くらいするとCPU使用率・ネットワーク帯域が余っているのにConnected・Disconnectedを繰り返すという症状が現れることがある。

以下のコマンドによりパケットロスを起こしていることが分かり、これに対処するにはSocketバッファの最大サイズを増やす必要がある。

$ netstat -s
...
Udp:
    10665511 packet receive errors
    10665511 receive buffer errors
...

StreamServerで必要なバッファの量は受信送信合わせて最大で

48[bytes/packet] * N[人] * 100[人] * 30[fps] + 48[bytes/packet] * N[人] * 30[fps]

であり、N=1000であれば約150MBである。実際には受信することによりバッファが空くのでこれほどは必要ないが念のため確保しておく。

# バッファの最大サイズを確認
$ sysctl net.core.rmem_max
net.core.rmem_max = 212992 # デフォルトではけっこう少ない

# デフォルトサイズも適当に増やしておく
$ sudo sysctl -w net.core.rmem_default=50000000
$ sudo sysctl -w net.core.rmem_max=150000000

positionstreamserver's People

Contributors

kai-maker avatar shosatojp avatar taku3939 avatar

Watchers

James Cloos 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.