자체 호스팅 LangSmith 인스턴스는 대량의 trace와 사용자를 처리할 수 있습니다. 자체 호스팅 배포의 기본 구성은 상당한 부하를 처리할 수 있으며, 더 높은 확장성을 달성하기 위해 배포를 구성할 수 있습니다. 이 페이지에서는 확장 고려 사항을 설명하고 자체 호스팅 인스턴스를 구성하는 데 도움이 되는 몇 가지 예제를 제공합니다.예제 구성은 확장을 위한 LangSmith 구성 예제를 참조하세요.
매우 높은 규모의 trace 수집이 있지만 프론트엔드에서 trace를 쿼리하는 사용자는 한 자릿수입니다.이를 위해 다음과 같은 구성을 권장합니다:
Copy
config: blobStorage: # Please also set the other keys to connect to your blob storage. See configuration section. enabled: true settings: redisRunsExpirySeconds: "3600"# ttl:# enabled: true# ttl_period_seconds:# longlived: "7776000" # 90 days (default is 400 days)# shortlived: "604800" # 7 days (default is 14 days)frontend: deployment: replicas: 4 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 4# minReplicas: 2platformBackend: deployment: replicas: 20 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 20# minReplicas: 8## Note that we are actively working on improving performance of this service to reduce the number of replicas.queue: deployment: replicas: 160 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 160# minReplicas: 40backend: deployment: replicas: 5 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 5# minReplicas: 3## Ensure your Redis cache is at least 200 GBredis: external: enabled: true existingSecretName: langsmith-redis-secret # Set the connection url for your external Redis instance (200+ GB)clickhouse: statefulSet: persistence: # This may depend on your configured TTL (see config section). # We recommend 600Gi for every shortlived TTL day if operating at this scale constantly. size: 4200Gi # This assumes 7 days TTL and operating a this scale constantly. resources: requests: cpu: "10" memory: "32Gi" limits: cpu: "16" memory: "48Gi"commonEnv: - name: "CLICKHOUSE_ASYNC_INSERT_WAIT_PCT_FLOAT" value: "0"
상대적으로 낮은 규모의 trace 수집이 있지만 많은 프론트엔드 사용자가 trace를 쿼리하거나 /runs/query 또는 /runs/<run-id> endpoint를 자주 호출하는 스크립트가 있습니다.이를 위해 낮은 지연 시간으로 높은 읽기 규모를 가능하게 하는 replicated ClickHouse cluster를 설정하는 것을 강력히 권장합니다. replicated ClickHouse cluster를 설정하는 방법에 대한 자세한 지침은 external ClickHouse 문서를 참조하세요. 이 부하 패턴의 경우 3 node replicated 설정을 사용하는 것을 권장하며, cluster의 각 replica는 8+ core 및 16+ GB 메모리의 리소스 요청과 12 core 및 32 GB 메모리의 리소스 제한을 가져야 합니다.이를 위해 다음과 같은 구성을 권장합니다:
Copy
config: blobStorage: # Please also set the other keys to connect to your blob storage. See configuration section. enabled: truefrontend: deployment: replicas: 2queue: deployment: replicas: 6 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 6# minReplicas: 4backend: deployment: replicas: 40 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 40# minReplicas: 16# We strongly recommend setting up a replicated clickhouse cluster for this load.# Update these values as needed to connect to your replicated clickhouse cluster.clickhouse: external: # If using a 3 node replicated setup, each replica in the cluster should have resource requests of 8+ cores and 16+ GB memory, and resource limit of 12 cores and 32 GB memory. enabled: true host: langsmith-ch-clickhouse-replicated.default.svc.cluster.local port: "8123" nativePort: "9000" user: "default" password: "password" database: "default" cluster: "replicated"
이것은 LangSmith의 대부분의 사용 패턴을 처리할 수 있는 좋은 전반적인 구성입니다. 내부 테스트에서 이 구성을 통해 초당 100개의 trace 수집과 초당 40개의 읽기 요청으로 확장할 수 있었습니다.이를 위해 다음과 같은 구성을 권장합니다:
Copy
config: blobStorage: # Please also set the other keys to connect to your blob storage. See configuration section. enabled: true settings: redisRunsExpirySeconds: "3600"frontend: deployment: replicas: 2queue: deployment: replicas: 10 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 10# minReplicas: 5backend: deployment: replicas: 16 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 16# minReplicas: 8redis: statefulSet: resources: requests: memory: 13Gi limits: memory: 13Gi # -- For external redis instead use something like below -- # external: # enabled: true # connectionUrl: "<URL>" OR existingSecretName: "<SECRET-NAME>"clickhouse: statefulSet: persistence: # This may depend on your configured TTL. # We recommend 60Gi for every shortlived TTL day if operating at this scale constantly. size: 420Gi # This assumes 7 days TTL and operating a this scale constantly. resources: requests: cpu: "16" memory: "24Gi" limits: cpu: "28" memory: "40Gi"commonEnv: - name: "CLICKHOUSE_ASYNC_INSERT_WAIT_PCT_FLOAT" value: "0"
매우 높은 trace 수집 속도(초당 1000개의 trace 제출에 근접)와 프론트엔드에서 trace를 쿼리하는 많은 사용자(50명 이상) 및/또는 /runs/query 또는 /runs/<run-id> endpoint에 지속적으로 요청하는 스크립트가 있습니다.이를 위해 높은 쓰기 규모에서 읽기 성능 저하를 방지하기 위해 replicated ClickHouse cluster를 설정하는 것을 매우 강력히 권장합니다. replicated ClickHouse cluster를 설정하는 방법에 대한 자세한 지침은 external ClickHouse 문서를 참조하세요. 이 부하 패턴의 경우 3 node replicated 설정을 사용하는 것을 권장하며, cluster의 각 replica는 14+ core 및 24+ GB 메모리의 리소스 요청과 20 core 및 48 GB 메모리의 리소스 제한을 가져야 합니다. 또한 ClickHouse의 각 node/instance가 활성화한 TTL의 각 일에 대해 600 Gi의 볼륨 스토리지를 갖는 것을 권장합니다(아래 구성에 따라).전반적으로 다음과 같은 구성을 권장합니다:
Copy
config: blobStorage: # Please also set the other keys to connect to your blob storage. See configuration section. enabled: true settings: redisRunsExpirySeconds: "3600"# ttl:# enabled: true# ttl_period_seconds:# longlived: "7776000" # 90 days (default is 400 days)# shortlived: "604800" # 7 days (default is 14 days)frontend: deployment: replicas: 4 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 4# minReplicas: 2platformBackend: deployment: replicas: 20 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 20# minReplicas: 8## Note that we are actively working on improving performance of this service to reduce the number of replicas.queue: deployment: replicas: 160 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 160# minReplicas: 40backend: deployment: replicas: 50 # OR enable autoscaling to this level (example below)# autoscaling:# enabled: true# maxReplicas: 50# minReplicas: 20## Ensure your Redis cache is at least 200 GBredis: external: enabled: true existingSecretName: langsmith-redis-secret # Set the connection url for your external Redis instance (200+ GB)# We strongly recommend setting up a replicated clickhouse cluster for this load.# Update these values as needed to connect to your replicated clickhouse cluster.clickhouse: external: # If using a 3 node replicated setup, each replica in the cluster should have resource requests of 14+ cores and 24+ GB memory, and resource limit of 20 cores and 48 GB memory. enabled: true host: langsmith-ch-clickhouse-replicated.default.svc.cluster.local port: "8123" nativePort: "9000" user: "default" password: "password" database: "default" cluster: "replicated"commonEnv: - name: "CLICKHOUSE_ASYNC_INSERT_WAIT_PCT_FLOAT" value: "0"
Kubernetes cluster가 권장 크기로 확장할 수 있는 충분한 리소스로 구성되어 있는지 확인하세요. 배포 후 Kubernetes cluster의 모든 pod는 Running 상태여야 합니다. Pending 상태에 있는 pod는 node pool 한계에 도달했거나 더 큰 node가 필요함을 나타낼 수 있습니다.또한 cluster에 배포된 모든 ingress controller가 병목 현상을 방지하기 위해 원하는 부하를 처리할 수 있는지 확인하세요.