title: Django APScheduler not executing jobs according to schedule with Apache and mod_wsgi
body: <p>I have a Django project that uses <a href="https://github.com/jarekwg/django-apscheduler" rel="nofollow noreferrer">django-apscheduler</a> with the following configuration:</p>
  
  <hr>
  
  <h3>Apache virtualhost</h3>
  
  <pre><code>WSGIPassAuthorization On
  
  WSGIScriptAlias / /some/app/wsgi.py
  WSGIDaemonProcess some-app \
          user=someapp threads=15 display-name=some-app \
          python-path=/some/app/venv/lib/python3.7/site-packages
  WSGIProcessGroup some-app
  </code></pre>
  
  <h3>Scheduled tasks</h3>
  
  <pre><code>from pytz import utc
  
  from apscheduler.schedulers.background import BackgroundScheduler
  from django_apscheduler.jobstores import DjangoJobStore, register_events, register_job
  
  from administration.scheduled_tasks import add_db_backup, delete_old_db_backups
  
  scheduler = BackgroundScheduler(timezone=utc)
  scheduler.add_jobstore(DjangoJobStore(), 'default')
  
  register_events(scheduler)
  
  @register_job(scheduler, 'cron', hour='0', minute='0')
  def db_backups_job():
      add_db_backup()
      delete_old_db_backups()
  
  scheduler.start()
  </code></pre>
  
  <hr>
  
  <p>As expected, the scheduled job is visible in Django admin. Also, the jobs execute <em>sometimes</em>, for example the daily job above has executed seven times during this month, although today is 15th and it should thus have executed 15 times. Note that I have restarted Apache during this time.</p>
  
  <p>This seems to be a process lifetime issue. It seems that the <code>mod_wsgi</code> process is suspended and thus APScheduler jobs cannot run.</p>
  
  <p>What is the lifetime of the <code>mod_wsgi</code> process? How can I assure that the jobs execute according to schedule or at least daily?</p>