jeroenhouben

jeroenhouben

Heroku performance problems - response times quadrupled and many timeouts (now solved)

Hi,

We recently experienced weird problems after een deployment that really only changed a bunch of JavaScript.

Response times quadrupled and we would get many timeouts.

We use this buildpack in Heroku: https://github.com/HashNuke/heroku-buildpack-elixir

We did several ENV var changes, playing around with the DB poolsize, all to no avail. In the end we changed one line in the buildpack:

# Always rebuild from scratch on every deploy?
always_rebuild=true

Setting this to true instead of false fixed our problems.

So this must means we had a rogue build or something. I must say that this sometimes (very rare) happens to my or my co-workers. Our phoenix app in dev mode will all of a sudden have terrible (seconds) response times. Cleaning the _build folder and recompiling then fixes everything. It seems a similar thing happened on heroku.

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

You could consider having that line printed via a Logger on application boot to ensure that it’s always the case, your problems seem to be intermittent so perhaps it will intermittently be false.

Another possible explanation simply has to do with the load on your app when it starts. Mix lazily loads code, so the first several requests that hit your app will have much higher response times while the code is being loaded. If there’s a lot of load, this could lead to timeouts.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Are you running a release or via mix? I’m wondering if sometimes the protocol consolidation artifacts aren’t being generated properly and so the requests end up using unconsolidated protocols, which are very slow (they hit the code server).

jeroenhouben

jeroenhouben

We just use mix, no releases. How would we find out if what you’re saying about unconsolidated protocols happened to us?

Running this on heroku works:

iex(3)> Protocol.consolidated?(Enumerable)
true

Where Next?

Popular in Questions Top

yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
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
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New

Other popular topics Top

William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
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
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement