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

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
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
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
earth10
Hi, I’m just starting to build a side-project with Elixir and Phoenix and doing some basic test with Elixir alone. What strikes me is th...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
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
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
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New

Other popular topics 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
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
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "eq...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31107 143
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I'm a nov...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement