I have an agent that is self hosted in gke, I disp...
# agents
b
I have an agent that is self hosted in gke, I dispatch 100 call that create 100 rooms but some room end empty. • 73 rooms agent joined ✅ • 27 rooms empty, python lk agent never runs or scheduled ❌ can anyone please help me in understanding why this might be happening ?
r
Maybe you don't have enough agent instances for all the calls?
b
@refined-appointment-81829 So if k8s does not horizontally scale fast enough, some rooms will be empty ? Is there a way to debug this ? Does LK provide any logs ? I tried to find more info, but no luck.
I noticed this issue happens more frequently when the scaling is less aggressive. Do you have any recommendation about scaling ?
Copy code
spec:
  scaleTargetRef:
    kind: Deployment
    apiVersion: apps/v1
  minReplicas: 1
  maxReplicas: 20
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 50
  behavior:
    scaleUp:
      stabilizationWindowSeconds: 30
      selectPolicy: Max
      policies:
        - type: Pods
          value: 2
          periodSeconds: 15
    scaleDown:
      stabilizationWindowSeconds: 600
      selectPolicy: Min
      policies:
        - type: Pods
          value: 1
          periodSeconds: 300
r
Probably check your agent logs
b
I check my logs • 73 logs of "received job request" from python lk agent • 100 logs of room creating from
Copy code
const result = await this.lkapi.createDispatch(
      task.roomName,
      task.livekitAgentId,
      {
        metadata: JSON.stringify(task.metadata),
      }
    );
@refined-appointment-81829 could you share any docs of related issues similar to this? I would appreciate any info or docs 🙏
r
Are you using the lk command line too to do the load test? Are you testing against a system that has had 100 agents running before and now running again or you are starting the agents and running the loadtest against a fresh start? At what rate are you trying to dispatch the agents?