natewallis

natewallis

Http request kills server

Hi,

I have an application which I have deployed to my server using distillery and the application that is a temporary application to store orders that are made to our business. I am providing a front end for sales staff to enter new orders that are placed with our business. When a small subset of orders is requested, all is working ok, but when all orders are requested (probably about 2000 orders), the application dies and I just see “Killed” on the screen.

I haven’t implemented pagination on the front end purely because this application will be shut down soon when our new CRM is up and running…

10:47:02.313 request_id=2np7ro3uojb3ei86l0000071 [info] GET /orders
Killed

I also see this in the mysql error log when /orders is requested

2020-02-11T23:47:02.692870Z 1863 [Note] Aborted connection 1863 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)
2020-02-11T23:47:02.692874Z 1862 [Note] Aborted connection 1862 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)
2020-02-11T23:47:02.692864Z 1859 [Note] Aborted connection 1859 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)
2020-02-11T23:47:02.692877Z 1865 [Note] Aborted connection 1865 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)
2020-02-11T23:47:02.692882Z 1864 [Note] Aborted connection 1864 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)
2020-02-11T23:47:02.692885Z 1860 [Note] Aborted connection 1860 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)
2020-02-11T23:47:02.692889Z 1866 [Note] Aborted connection 1866 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)
2020-02-11T23:47:02.692893Z 1858 [Note] Aborted connection 1858 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)
2020-02-11T23:47:02.692822Z 1867 [Note] Aborted connection 1867 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)
2020-02-11T23:47:02.692897Z 1861 [Note] Aborted connection 1861 to db: 'interim_crm_prod' user: 'root' host: 'localhost' (Got an error reading communication packets)

NGINX logs say this:

2020/02/12 10:47:02 [error] 7236#7236: *45826 upstream prematurely closed connection while reading response header from upstream, client: 203.7.6.188, server: crm.bar-fridges-australia.com.au, request: "GET /orders?search= HTTP/1.1", upstream: "http://127.0.0.1:4000/orders?search=", host: "crm.bar-fridges-australia.com.au", referrer: "https://crm.bar-fridges-australia.com.au/orders?start_date=2019-10-01&end_date=2019-12-31"

Does anyone have any other debugging ideas that I can use?

Most Liked

wanton7

wanton7

Googled a bit and “Killed” does really sound like you are running out of memory.

Your system must not have swap file enabled. But not sure why would just 2000 orders take so much memory to kill your system. You machine must be really close to its memory limit before that request. I would check available memory before request. Maybe your system has low amount of memory to begin with or maybe your app already uses lot of memory before that crashing request. If it’s latter, your should profile your memory usage to see what uses it.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hi @natewallis are you storing orders in memory? Is your application using too much memory and being killed by the system?

Where Next?

Popular in Questions Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
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
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

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
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 43806 214
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127536 1222
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement