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?

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

1 Like

Hi Ben, yes, I guess they would be stored in memory when rendering to HTML…

I think pagination will probably be the best solution…

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.

2 Likes