Getting twirp error: no response from server when ...
# ask-ai
g
Getting twirp error: no response from server when running the egress on an ec2 instance. 2025-11-25T113455.622Z INFO egress stats/monitor.go:145 cpu available: 48.000000 max cost: 4.000000 {"nodeID": "NE_66tpiLk7sRxw", "clusterID": ""} What is this max_cost and will increasing this makes sense? I am using 48 vcpus.
t
Thanks for reaching out, Harsh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're seeing the log line about CPU and max_cost while running egress. I'll explain what that value means and how to proceed with your twirp error. Regarding the log line you quoted • "max_cost: 4.000000" is the per-job CPU cost the Egress service uses for scheduling. It represents CPU cores reserved per egress job (configured via
cpu_cost
), so at 48 vCPUs a max_cost of 4 allows roughly 48 / 4 = 12 concurrent CPU-heavy jobs per worker. • Increasing
max_cost
would reserve more CPU per job and therefore reduce the number of concurrent jobs the worker will accept. If your goal is to run more concurrent egress jobs, you should lower
cpu_cost
(not increase it) or add/scale workers/load-balance them. About the "twirp error: no response from server" • This is a client-server communication failure — the Egress service did not reply to the RPC. Common causes: ◦ Egress process not running or not listening on the expected port ◦ Network / firewall / security-group rules blocking access to the instance/port ◦ Service health issues (crashing, blocked on resources) ◦ Redis or coordination problems preventing the service from accepting jobs ◦ Incorrect endpoint or credentials (e.g.,
LIVEKIT_WS_URL
,
api_key
,
api_secret
) • Check the Egress service health and availability endpoints (
/health
,
/availability
) if enabled, confirm the service is bound to the expected port, and inspect Egress logs around the twirp error for connection timeouts or crashes. Next steps I recommend 1. Confirm how you deployed Egress (bare EC2 process, Docker, or Kubernetes/Helm). 2. On the EC2 instance: ◦ Verify the egress process is running and listening on the configured port (ss/netstat/docker ps). ◦ Check security group and OS firewall to ensure the port is reachable from the client. ◦ Inspect Egress logs for errors preceding the twirp message and for Redis connection errors. 1. If you want more concurrency: reduce
cpu_cost
(the
max_cost
log will reflect that change) or add more workers. 2. Share these details so I can help further: ◦ deployment method (Docker, systemd, k8s/Helm) ◦ relevant Egress config (value of
cpu_cost
and ports), and a few log lines around the twirp error ◦ whether Redis is reachable and any Redis-related log entries Would you like help interpreting the Egress logs if you paste the surrounding lines and your `cpu_cost`/deployment details? Sources: Self-hosting the Ingress Service | LiveKit docs | Self-hosting the Egress Service | LiveKit docs
g
my storage on the egress server was full. Why are the files recorded that are sent to s3 being stored on the local server?
t
You're right to be concerned — local disk filling can disrupt egress. Here's why recorded files appear on the egress server and what you can do about it. Why files are written locally • The Egress process must produce and finalize media output (MP4 files, HLS segments, etc.) locally first because the encoder/packager (GStreamer) writes files to disk before they are uploaded to S3. • After segments or final files are produced, the Egress service uploads them to S3. A local copy exists at least temporarily during creation and finalization; depending on configuration or runtime behavior those local files may remain after upload. How this leads to full disks • Long-running recordings, many concurrent jobs, or large outputs will consume local storage until uploads complete and/or local files are cleaned up. • If uploads fail, are slow, or cleanup is not configured, local files accumulate and can fill the disk. What you can do right now • Free space immediately: remove old output files from the Egress output directory on the instance. • Check Egress logs for upload errors or timeouts that might have prevented cleanup. • Verify S3 upload success for recent jobs before deleting local files. Preventive options • Provision larger disks on your Egress instances to accommodate temporary files. • Reduce concurrent/long-running recordings per worker (adjust
cpu_cost
or scale workers) to limit simultaneous disk usage. • Implement a cleanup process that removes local files after successful upload (cron/systemd script) or on a retention schedule. • Monitor disk usage with alerts so you catch growth before it becomes critical. If you want, tell me: • how you deployed Egress (bare EC2, Docker, or k8s/Helm), • the Egress output directory path and any cleanup settings you’ve tried, and I’ll suggest specific cleanup commands or a simple cleanup script tailored to your setup. Sources: RoomComposite Egress | LiveKit Docs | Universal Egress | Self-hosting the Egress Service | LiveKit docs
g
i deployed egress using docker, which are the temp files i should delete?
t
Thanks — since you deployed Egress with Docker, here’s how to safely free space and which files to remove. Which files to delete • Delete media files in the container writable layer or any mounted output volume that match your egress output patterns (
filepath
,
filename_prefix
) — e.g., MP4 files, HLS segments (.m3u8/.ts), or WebM files created during jobs. These are safe to remove only after you verify the corresponding uploads succeeded in S3. • Remove any unfinished/failed output files from jobs that have errored and won’t be retried. Where to look • If you mounted a host volume for egress outputs (recommended): check that mount path on the host (e.g.,
~/livekit-egress
or whatever you mapped) and delete media files there. • If you did NOT mount a volume: files live inside the container writable layer. List large files by running a cleanup container or exec into the egress container and check common paths (container work dir or root) for large media files. Commands you can run on the host (adjust paths and container name): 1. Check disk usage and find large files in a mounted directory: ◦
du -sh /path/to/egress/*
◦
find /path/to/egress -type f -name '*.mp4' -o -name '*.ts' -o -name '*.m3u8' -printf '%s %p\n' | sort -rn | head
1. If files are inside the container and you need to inspect: ◦
docker ps
(get container name) ◦
docker exec -it <container> /bin/sh
or
/bin/bash
◦ Inside container:
du -sh /*
or
find / -type f -name '*.mp4' -o -name '*.ts' -o -name '*.m3u8'
1. Remove files after confirming upload: ◦
rm /path/to/egress/file.mp4
◦ Or from container:
docker exec <container> rm /path/to/file
Precautions • Verify the file exists in S3 before deleting local copies. • If jobs are currently running, avoid deleting files they may still be writing to. • Consider stopping the egress container briefly if you need to safely delete many files and prevent concurrent writes. Prevention suggestions • Mount a dedicated host volume for egress outputs so you can manage disk usage easily. • Add a cleanup cron job that deletes local files older than N hours after confirming uploads, e.g.: ◦
find /path/to/egress -type f -mtime +2 -name '*.mp4' -delete
(adjust age) • Monitor disk usage and alert when near capacity. If you tell me the host mount path you used (or whether you didn’t mount a volume) and the container name, I can give exact commands tailored to your setup. Sources: Self-hosting the Egress Service | LiveKit docs | Track egress | LiveKit docs | Recording and export | LiveKit docs