marschro

marschro

Phoenix LiveView - App responds slow in Production environment every ~20 seconds

Hello all,
I am currently experiencing some strange behavior on my production environment.

  • I run a Phoenix LiveView App
  • Server is FreeBSD with haproxy upfront

The behavior

  • If you navigate the liveView app via navigation items that trigger link navigate, this is most of the time fine. But every ~22 seconds the socket response is extremely slow and response, event with nearly zero change in the socket is about 4 to 6 seconds.
  • you can give it a try here: https://portal.devpunx.com (of course you have to click on the navigation for at leas 22 seconds… no need to click different nav-items… just keep clicking “home” or sth.)
  • I do not have this on local, so it’s probably an environment effect.

What I tried to debug:

  • I checked and changed timeouts on Server and OS but that seems not to cause the issue
  • Also I checked if sockets break and reconnect, but they stay stable
  • So it basically is slowed down for some reason.
  • What makes me stutzig is the fact, that it occurs roughly every 22 seconds independently of if you click a lot or not so much.

Has anyone any idea how to approach that and how to debug?

Kind regards!

Marked As Solved

derek-zhou

derek-zhou

portal.devpunx.com does not respond to ping and I cannot load the website though several popular website performance tools, such as pagespeed.web.dev. Feels like a misconfigured network. Have you complained to your hosting company?

Also Liked

D4no0

D4no0

Each time I hear about these kind of problems, reminds me of this talk :sob: :

marschro

marschro

Okay, final update as its now fixed…

  • I was debugging the app for days
  • checking for memory leaks
  • optimizing sockets
  • debugging and logging haproxy
  • checked server performance and issues
  • searched for any possible side effect…

Now I opened a ticket at the hostel company and send them logs from mtr which showed significant packet loss.

They immediately knew what to do and fixed it. So it was finally no Phoenix, no Elixir, no Erlang, no BSD jails, no FreeBSD, no haproxy, no firewall issue…
but something in the “network backend” near de-cix… dunno anything on details.

But it shows, that really small problems can take days for debugging…
Heads up! never give up debugging :smiley:

Thanks to everyone who just supported me, by giving their input to this thread - helped me to keep debugging :smiley:

marschro

marschro

Further investigation:

  • I deployed the whole app with fly.io
  • I was not able to reproduce the issue there.
  • So its a proxy and infrastructure problem an not an issue on app-level or app-framework level…
    … will investigate further

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement