지정된 동시 실행 값은 최댓값이며, 인스턴스의 CPU가 이미 많이 사용되는 경우 Knative serving은 지정된 컨테이너 인스턴스에 많은 요청을 보내지 못할 수 있습니다.
다음 다이어그램은 동시 실행 설정이 수신되는 동시 실행 요청을 처리하는 데 필요한 컨테이너 인스턴스 수에 어떻게 영향을 미치는지 보여줍니다.
동시 실행을 한 번에 하나의 요청으로 제한해야 하는 경우
한 번에 하나의 요청만 실행 중인 각 컨테이너 인스턴스에 전송되도록 동시 실행을 제한할 수 있습니다. 다음과 같은 경우에 동시 실행 제한을 고려해야 합니다.
각 요청 실행 시 사용 가능한 CPU 또는 메모리 대부분이 사용됩니다.
컨테이너가 두 요청이 공유할 수 없는 전역 상태에 있는 경우와 같이 컨테이너 이미지가 여러 요청을 동시에 처리하도록 설계되지 않았습니다.
수신 요청의 급증을 처리하기 위해 많은 인스턴스가 시작되어야 하기 때문에 동시 실행 값이 1이면 확장 성능에 부정적인 영향을 미칠 가능성이 높습니다.
우수사례
다음 측정항목은 400개의 클라이언트가 최대 동시 실행이 1로 설정된 Knative serving 서비스에 대해 초당 3개의 요청을 수행하는 사용 사례를 보여줍니다. 위쪽의 녹색 선은 시간에 경과에 따른 요청 횟수를 나타내고, 아래쪽의 파란색 선은 요청을 처리하기 위해 시작된 컨테이너 인스턴스 수를 나타냅니다.
다음 측정항목은 400개의 클라이언트가 최대 동시 실행이 80으로 설정된 Knative serving 서비스에 대해 초당 3개의 요청을 수행하는 사용 사례를 보여줍니다. 위쪽의 녹색 선은 시간에 경과에 따른 요청 횟수를 나타내고, 아래쪽의 파란색 선은 요청을 처리하기 위해 시작된 컨테이너 인스턴스 수를 나타냅니다. 동일한 요청 볼륨을 처리하는 데 필요한 인스턴스 수가 훨씬 더 적게 필요한 것을 볼 수 있습니다.
다음 단계
Knative serving 서비스의 동시 실행을 관리하려면 동시 실행 설정을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Concurrency\n\nIn Knative serving, each [revision](/kubernetes-engine/enterprise/knative-serving/docs/resource-model#revisions)\nis automatically scaled to the number of container instances needed to handle\nall incoming requests.\n\nWhen more container instances are processing requests, more CPU and memory will\nbe used, resulting in higher costs.\nWhen new container instances need to be started, requests might take more time\nto be processed, decreasing the performances of your service.\n\nTo give you more control, Knative serving provides a *concurrency* setting\nthat specifies the maximum number of requests that can be processed\nsimultaneously by a given container instance.\n\nConcurrency values\n------------------\n\nBy default Knative serving container instances can receive many requests at\nthe same time (up to a maximum of 80).\nNote that in comparison, Functions-as-a-Service (FaaS) solutions like\nCloud Run functions have a fixed concurrency of 1.\n\nAlthough you should use the default concurrency value, if needed you can\n[lower the maximum concurrency](/kubernetes-engine/enterprise/knative-serving/docs/configuring/concurrency). For example,\nif your code cannot process parallel requests,\n[set concurrency to `1`](#concurrency-1).\n\nThe specified concurrency value is a maximum and Knative serving might not\nsend as many requests to a given container instance if the CPU of the instance\nis already highly utilized.\n\nThe following diagram shows how the concurrency setting affects the number of\ncontainer instances needed to handle incoming concurrent requests:\n\nWhen to limit concurrency to one request at a time\n--------------------------------------------------\n\nYou can limit concurrency so that only one request at a time will be sent to\neach running container instance. You should consider doing this in cases where:\n\n- Each request uses most of the available CPU or memory.\n- Your container image is not designed for handling multiple requests at the same time, for example, if your container relies on global state that two requests cannot share.\n\nNote that a concurrency of `1` is likely to negatively affect scaling\nperformance, because many container instances will have to start up to handle a\nspike in incoming requests.\n\nCase study\n----------\n\nThe following metrics show a use case where 400 clients are making 3 requests\nper second to a Knative serving service that is set to a maximum concurrency\nof 1. The green top line shows the requests over time, the bottom blue line\nshows the number of container instances started to handle the requests.\n\nThe following metrics show 400 clients making 3 requests per second to a\nKnative serving service that is set to a maximum concurrency of 80. The green\ntop line shows the requests over time, the bottom blue line shows the number of\ncontainer instances started to handle the requests. Notice that far fewer\ninstances are needed to handle the same request volume.\n\nWhat's next\n-----------\n\nTo manage the concurrency of your Knative serving services, see\n[Setting concurrency](/kubernetes-engine/enterprise/knative-serving/docs/configuring/concurrency).\n\nTo optimize your concurrency setting, see\n[development tips for tuning concurrency](/kubernetes-engine/enterprise/knative-serving/docs/tips/general#tuning-concurrency)."]]