[BG-387]: 유저 웹 소켓 연결 커넥션 수 제한 (4h / 2h) #107
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
분산된 서버 환경에서 커넥션 수를 제한을 구현해야 되서
기존에 생각했던 것 보다 오래 걸렸다
How
워크스페이스 유저의 최대 커넥션 수를 20으로 제한하였다
제한된 커넥션 보다 너 많은 요청시
가장 오래된 커넥션을 찾고
해당 서버에 관련 커넥션이 있으면 redis 와 socket session을 삭제하고
해당 서버에 없으면 redis pub/sub을 사용하여 삭제 요청을 한다
Link
BG-387