Timeout on Presence.track

Hi all,

I’ve been experiencing a problem with my Presence.track function timing out, I think potentially that it’s happening with a large amount of concurrent connections but I can’t be sure.

Essentially I get this error:

{:timeout, {GenServer, :call, [.Presence_shard0, {:track, #PID<0.27226.161>, “”, “”, %{}}, 5000]}}

My Presence :after_join isn’t complex, it’s straight from the example code and I’m using it to track presences in a room (from my understanding this is exactly what its use case is). My elixir nodes are clustered and multi-region through Fly.io and the VMs that the errors are occurring on aren’t maxing out by any means (CPU and memory are low, message queues are fine, as are scheduler utilization).

Should I look at implementing some sort of back-pressure or something? I’m not sure if this error is just a symptom of another problem (maybe throughput?). What I’m looking for is possible ways to make this more performant or just an idea of what a potential cause could be.

I’ve been struggling with this issue for a while so it would be great if someone could point me in the right direction at least.


1 Like

Quick correction here. It seems like I do have messages piling up in queue and my application monitoring software wasn’t reporting it.

I’ve messages piling up in the Presence process, as well as Phoenix.Channel.Server.init processes though mostly in the Presence process