I am self-hosting egress. How can I know that egre...
# ask-ai
h
I am self-hosting egress. How can I know that egress server is working well?
t
Thanks for reaching out, Fatima. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To ensure that your self-hosted egress server is working well, you can monitor its performance and health using the following methods: • Health Status Monitoring: Use a health port to check the server's status. This can help you verify that the server is running and responding as expected. • CPU Load Monitoring: Monitor the CPU load to ensure the server is not overburdened and is performing efficiently. • Egress Status Tracking: Track updates on the egress status to confirm that processes are completing successfully and to identify any errors. • Service Idle State Checking: Verify that the service is idle when no tasks are running, which indicates proper resource management. These methods can help you evaluate the performance and reliability of your egress server. If you need further assistance with setting up or interpreting these metrics, feel free to ask! Sources: Self-hosting the Egress Service | LiveKit Docs | GitHub::livekit::livekit_composite | livekit/egress/test/runner.go
h
How can I do all these here:
Copy code
async def entrypoint(ctx: JobContext):
    # Add the following code to the top, before calling ctx.connect()

    # Set up recording
    req = api.RoomCompositeEgressRequest(
        room_name=ctx.room.name,
        audio_only=True,
        file_outputs=[api.EncodedFileOutput(
            file_type=api.EncodedFileType.OGG,
            filepath="livekit/my-room-test.ogg",
            s3=api.S3Upload(
                bucket="<S3 bucket name>",
                region="<S3 region>",
                access_key="<S3 access key>",
                secret="<S3 secret key>",
            ),
        )],
    )

    lkapi = api.LiveKitAPI()
    res = await lkapi.egress.start_room_composite_egress(req)

    await lkapi.aclose()
t
Hey there! Let me walk you through setting up a RoomCompositeEgressRequest in LiveKit using Python. It's totally doable, and I'll break it down step by step to make it super clear. 1. First up, import the LiveKit API: 2. Now, let's set up the RoomCompositeEgressRequest in your entrypoint function. Don't worry, I've got an example that'll help you out: 3. A quick heads up: make sure to swap out those placeholder values like
<S3 bucket name>
,
<S3 region>
,
<S3 access key>
, and
<S3 secret key>
with your actual S3 credentials and bucket details. 4. Pro tip: Double-check that you've got the right permissions and configurations set up for your S3 bucket to allow uploads. Got questions? I'm here to help! Don't hesitate to reach out if anything seems tricky or you need a bit more guidance. We'll get this sorted together! Sources: Recording agent sessions | LiveKit Docs
h
Can I save the recording in a local folder, and not on cloud?
t
Great news! You can absolutely save LiveKit egress recordings right to your local folder - no cloud storage required. Let me walk you through this super simple process, like a friend helping a friend. 1. First up, when you're starting the egress service, just mount a volume to your local directory using the
docker run
command. Here's a handy example: 2. Next, in your egress request configuration, use the mounted directory path for your file output. Pro tip: you could set the file path to something like
/out/my-recording.mp4
. 3. One quick thing to remember - make sure that mounted directory has write permissions for all users, since the egress service isn't running as root. And just like that, your recordings will be safely saved in your local folder! If you run into any hiccups or have questions, I'm right here to help. You've got this! 😊 Sources: GitHub::livekit::livekit_composite | livekit/egress/README.md