[Server] Server shutdown problem - Django memory leak with scrapy

Posted by qwlake on December 3, 2020

Finding reasons

  1. Add logging system to Django project. → Found Reason 1.
  2. Add AWS EC2 instance memory monitor to cloud watch. → Found Reason 2. https://brunch.co.kr/@topasvga/615

Reason 1.

1
TypeError: argument must be an int, or have a fileno() method.

TypeError: argument must be an int, or have a fileno() method. · Issue #49 · ppcomp/knu-notice-server

Reason 2.

Django Memory Leak

image

Direction

Why memory leak?

메모리 누수가 발생하는 원인 찾기

cf. https://medium.com/@elastic7327/운영중인-장고-지유니콘-앱백엔드-메모리-누수-문제-해결-production-django-gunicorn-backend-memory-leak-fix-feat-uwsgi-b6013e3e0514

If not possible?

임시방편으로 메모리 누수로 인한 커널패닉이 일어나기 전에 재부팅해주기