Skip to content

ConnectCommand가 메인 서버 스레드에서 HTTPS API 요청을 처리하여 서버 지연이 발생됩니다. #2

@Dot0420

Description

@Dot0420

내용
spark로 프로파일링하던 중, 플러그인의 connect 관련 명령어 실행 시 외부 HTTPS API 요청이 메인 서버 스레드에서 처리되는 것으로 보였습니다.
확인된 호출 흐름은 대략 아래와 같습니다.

Server thread
... performCommand()
PluginCommand.execute()
kr.ssapi.commands.ConnectCommand.onCommand()
kr.ssapi.utils.ConnectionUtil.connectApi()
kr.ssapi.utils.Api.connectApi()
HttpsURLConnectionImpl.getInputStream()/getOutputStream()
SSLSocketImpl.read...
SocketInputStream.read...

즉, 명령어 실행 과정에서 외부 API와의 HTTPS 통신이 서버 메인 스레드에서 동기적으로 처리되고 있으며, 응답이 지연될 경우 해당 시간만큼
서버 전체가 멈추거는 현상이 있습니다.

서버 환경

  • paper 1.21.8
  • 동접 131명
  • 데이터베이스에 연결해서 사용하고 있으며, 다중 서버입니다. (총 7개 서버)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions