기본 콘텐츠로 건너뛰기

socketcluster tutorial - 1. 소개 Introduction

소개

SocketCluster는 빠르고 확장성이 뛰어난 HTTP + WebSockets 서버 환경으로, 시스템/인스턴스의 모든 CPU 코어를 사용하는 다중 프로세스 실시간 시스템을 구축할 수 있습니다.
Node.js 서버를 단일 스레드로 실행해야하는 한계를 없애고 worker 충돌에서 자동으로 복구하여 백엔드를 복원합니며. 오류도 중앙 로그로 모아줍니다.

SocketCluster는 Docker 컨테이너의 Kubernetes에서 실행되도록 최적화되어 있습니다 (자세한 내용은 SCC 참조).

SocketCluster는 pub/sub시스템(브라우저 / IoT 장치까지)과 같이 작동합니다. - 실제로 필요한 특정 이벤트를 클라이언트에게 전달합니다. SC는 수직으로 (프로세스의 클러스터로서) 수평적으로 (여러 머신 / 인스턴스) 모두 확장 할 수 있도록 설계하였습니다.

SC는 모듈 구조로 설계하였으므로 express와 같은 다른 프레임 워크 위(또는 자신 만의 빌드!)에서 동작가능합니다. SC의 실시간 API는 Socket.io의 API와 비슷합니다.

SocketCluster를 독립형 프레임 워크(HTTP 및 WebSocket 서버로 작동)로 사용하거나 실시간 엔진으로 만 사용하고 클라이언트 스크립트를 별도로 제공할 수 있습니다. http://npmjs.org/socketcluster-client를 참조하십시오.

Twitter를 팔로우하세요. http://socketcluster.launchrock.com/ 에서 업데이트를 구독하세요.

이 사이트는 오픈 소스이기도 하며 Github 참여를 환영합니다.

게임에서


SC는 멀티 플레이어 온라인 게임 제작에 이상적입니다. Phaser 데모를 보십시오. 대역폭 소비를 줄이려면 sc-codec-min-bin과 함께 SC를 사용하는 것이 좋습니다. 이 코덱은 SC 메시지를 압축하여 유선을 통해 전송 될 때 이진 패킷으로 변환합니다. 또는 특정 게임/응용 프로그램에 최적화 된 자신만의 코덱을 작성할 수도 있습니다.

메모리 누출 프로파일


SC는 메모리 누수 여부를 테스트 하였습니다. 마지막 전체 메모리 프로파일 링은 v0.9.17 (Node.js v0.10.28)에서 수행되었으며 작업자 및 브로커 프로세스에 대한 검사가 포함되었습니다. 메모리 누수가 발견되지 않았습니다.

주요 공여자


Jonathan Gros-Dubois
Matt Krick
Alex Hultman
Anatoliy Popov
Sachin Shinde
Nick Kotenberg
Rob Borden
Nelson Zheng
Lihan Li
MegaGM
wactbprot

댓글

이 블로그의 인기 게시물

세상 간단한 https(+secured websocket): Caddy

nginx, apache2 같은 걸로 매번 certbot 연동을 통해 https 하는게 지겨워서 알아보니 Caddy라는게 있더라. 설치법은 강하게 크기 위해 알아서 해본다. # cat /etc/caddy/Caddyfile your.shitty.site:8123 {   proxy / localhost:9123 {     websocket     transparent   } } 이건 외부에서 8123으로 들어오는 걸 내부적으로 9123로 맞춰서 https 맞춰주는 reverse proxy. 만일 port를 생략하면 # cat /etc/caddy/Caddyfile your.shitty.site {   proxy / localhost:9123 {     websocket     transparent   } } 기본포트인 443으로 되어 https://your.shitty.site 로 접속이 된다. 요새 말썽이던 cloudflare 버리고 netlify domain이랑 caddy를 쓰니까 앓던 이가 빠진 느낌. 이 조합은 당분간 계속 써야겠다 싶다.

저지연 오디오 생성 LLVC 사용기

https://github.com/KoeAI/LLVC 써봄 CUDA 11.8 버전 쓰고 있어 pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 VC 없어서 설치 https://wikidocs.net/168848 참조 FAIRSEQ 관련 오류 https://github.com/facebookresearch/fairseq/issues/2908 pip install editdistance  설치 No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8' 오류 멀쩡하게 있는데 안됨. pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 다시 설치 set DISTUTILS_USE_SDK=1 이게 문젠가 설정하고 재도전 Using cached ruamel.yaml.clib-0.2.8-cp311-cp311-win_amd64.whl (118 kB) Building wheels for collected packages: fairseq   Building wheel for fairseq (pyproject.toml) ... error   error: subprocess-exited-with-error   × Building wheel for fairseq (pyproject.toml) did not run successfully.   │ exit code: 1   ╰─> [1829 lines of output]       No CUDA runtime is found, usi...