Getting lots of "Connection errored out" lately

Hello.

I’ve been getting a bunch of these lately on a couple of my spaces (last 3 days):

Doesn’t happen when run locally. Not sure if they are related to caching the examples… or the queue… but I tried changing some of the queue settings and it didn’t seem to make a difference.

Is there a way to disable the queue completely ?

Space is here:

Hi @thiagohersan,

Can you track on your logs and see if you’re OOM?

To disable queue you can try this.
demo.launch(show_api=False, enable_queue=False)

But the queue is nice :smiling_face_with_three_hearts: it won’t help disable it if it’s OOM.

Ohhh… you’re probably right ! It’s probably OOM.
Let me check and if needed I’ll remove some of the examples…

1 Like

@radames how do I check memory usage ?

I don’t see any errors on the container logs when I enable debug.

Removing some of the example images made it not error out as often. I’ll leave it like this for now.

@thiagohersan here you can use the every param to have a live update of your component.
you need the queue enabled, though since it uses websockets under the hood.

import gradio as gr
import psutil

def get_system_memory():
    memory = psutil.virtual_memory()
    memory_percent = memory.percent
    memory_used = memory.used / (1024.0 ** 3)
    memory_total = memory.total / (1024.0 ** 3)
    return {"percent": f"{memory_percent}%", "used": f"{memory_used:.3f}GB", "total": f"{memory_total:.3f}GB"}


with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column():
            gr.Textbox(value="Hello Memory")
        with gr.Column():
            gr.JSON(get_system_memory, every=1)

demo.queue().launch(debug=True) 

Ace ! Thanks very much.

1 Like