2017-06-16 55 views
0

與此類似的問題,我問及如何在Rails應用程序中刪除直播記錄,我怎麼做到這一點的鳳凰How to delete a record from production in Rails刪除記錄在鳳凰應用

我試圖heroku run iex -S mix phx.server,但我得到了波紋管的錯誤:

Simons-MBP:iotc Simon$ heroku run iex -S mix phx.server 
Running iex -S mix phx.server on ⬢ icingonthecake... up, run.3732 (Free) 
Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] 

14:29:43.723 [info] Running Iotc.Web.Endpoint with Cowboy using http://:::54253 
14:29:43.734 [error] Postgrex.Protocol (#PID<0.276.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp" 
14:29:43.734 [error] Postgrex.Protocol (#PID<0.282.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp" 
14:29:43.734 [error] Postgrex.Protocol (#PID<0.287.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp" 
14:29:43.734 [error] Postgrex.Protocol (#PID<0.281.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp" 
14:29:43.734 [error] Postgrex.Protocol (#PID<0.284.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp" 
14:29:43.734 [error] Postgrex.Protocol (#PID<0.279.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp" 
14:29:43.734 [error] Postgrex.Protocol (#PID<0.286.0>) failed to connect: ** (Postgrex.Error) FATAL 53300 (too_many_connections): too many connections for role "onktihhpdhhwlp" 
+1

這聽起來像是你打一些Heroku的數據庫連接限制。 Phoenix創建一個連接池,你可能也運行該應用程序。 – Dogbert

回答

0

這是最有可能在apps/<yourapp>/config/*.exs文件pool_size問題 - 如果你正在使用鳳凰1.3是(不知道在哪裏的CONFIGS都在1.2以下)。我在本地機器上設置爲60,如果我已經有一個控制檯運行,我甚至無法執行任何混合任務。我把我的pool_size降到10,並沒有問題。

參考:https://github.com/elixir-ecto/postgrex/issues/210#issuecomment-239941678