My Django project is running on gunicorn. Sometimes loading a page (and oracle procedures calls related) takes a lot of time. This occurs 90/100 when the server remains inactive for some minutes.

How can I approach to this problem?


import os
import site
import sys

from whitenoise.django import DjangoWhiteNoise

# Add the site-packages of the chosen virtualenv to work with

# Add the app's directory to the PYTHONPATH
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "esmart2.settings")

# Activate your virtual env
activate_env = os.path.expanduser("/new_esmart/esmart_env/bin/activate_this.py")
execfile(activate_env, dict(__file__=activate_env))

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
application = DjangoWhiteNoise(application)


             total       used       free     shared    buffers     cached
Mem:          3962       3727        234          0        394       2268
-/+ buffers/cache:       1064       2897
Swap:         4095          0       4095


Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 45
Stepping:              7
CPU MHz:               1995.000
BogoMIPS:              3990.00
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              15360K
NUMA node0 CPU(s):     0,1
  • Are you using some type of caching ? Like memcached ? And have you tried to call directly a query after the inactivity period ? Just to be sure if your db is hanging instead of Gunicorn.
    – Marcs
    Oct 19 '16 at 1:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.