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

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
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
Tee
can someone please explain to me how Enum.reduce works with maps
New
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
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
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
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
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
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

Other popular topics Top

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
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30840 112
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
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 53578 245
New
RisingFromAshes
I've read in another post that it may be possible with a router helper - but I couldn't find an appropriate one, and tbh, I'm still just ...
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
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
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New

We're in Beta

About us Mission Statement