nignx unit 멀티쓰레드 설정

nginx unit 은 1.21.0 버전부터 python 멀티 쓰레드 설정을 할수 있게 되었다.

멀티 쓰레드 설정을 위해서 Appliacation 설정에 threads 키를 추가 하고 원하는 숫자(정수) 를 지정하면 된다.

    "applications": {
        "my_app": {
            "type": "python",
            "path": "/path/to/my/app",
            "module": "wsgi",
            "threads": 4
        }
    }

참고 문서 : https://unit.nginx.org/configuration/#python

nginx unit 는 쓰레드 기반의 아키텍처를 사용하기 때문에 python GIL(글로벌 인터프리터 락)의 영향을 받지 않는다고 한다. https://github.com/nginx/unit/issues/33

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다