WebFaction
Community site: login faq

I've got 2 Django projects on a Django1.2.1/Apache/wsgi stack using virtualhosts. Frequently Apache goes down. I've pasted my error logs from when it goes down.

You can see it is complaining about a missing 500.html template. I have a 500.html template now, so the crashes happen no matter. Plus, why would it be looking for the 500.html template anyway, the app doesn't get any traffic.

Any thoughts, this is really annoying because it brings down my other django project.

http://dpaste.com/541670/

[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1] mod_wsgi (pid=23629): Exception occurred processing WSGI script '/home/daninma/webapps/django1_2_1/streetbooking/prod_django.wsgi'.
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/core/handlers/wsgi.py", line 241, in __call__
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]     response = self.get_response(request)
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/core/handlers/base.py", line 130, in get_response
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]     return self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/core/handlers/base.py", line 181, in handle_uncaught_exception
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]     return callback(request, **param_dict)
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/views/defaults.py", line 23, in server_error
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]     t = loader.get_template(template_name) # You need to create a 500.html template.
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/template/loader.py", line 157, in get_template
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]     template, origin = find_template(template_name)
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/template/loader.py", line 138, in find_template
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1]     raise TemplateDoesNotExist(name)
[Thu May 12 11:57:27 2011] [error] [client 127.0.0.1] TemplateDoesNotExist: 500.html
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1] mod_wsgi (pid=23628): Exception occurred processing WSGI script '/home/daninma/webapps/django1_2_1/streetbooking/prod_django.wsgi'.
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/core/handlers/wsgi.py", line 241, in __call__
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]     response = self.get_response(request)
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/core/handlers/base.py", line 130, in get_response
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]     return self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/core/handlers/base.py", line 181, in handle_uncaught_exception
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]     return callback(request, **param_dict)
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/views/defaults.py", line 23, in server_error
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]     t = loader.get_template(template_name) # You need to create a 500.html template.
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/template/loader.py", line 157, in get_template
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]     template, origin = find_template(template_name)
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]   File "/home/daninma/webapps/django1_2_1/lib/python2.6/django/template/loader.py", line 138, in find_template
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1]     raise TemplateDoesNotExist(name)
[Thu May 12 11:57:30 2011] [error] [client 127.0.0.1] TemplateDoesNotExist: 500.html
[Thu May 12 12:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 12:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 12:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 12:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 12:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 11:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 12:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 12:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 11:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 12:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 12:06:40 2011] [error] Exception KeyError: KeyError(-1208080704,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 11:06:40 2011] [notice] caught SIGTERM, shutting down

UPDATE:

After enabling debugging in settings.py for both projects and in httpd.conf I got this:

[Thu May 12 12:57:40 2011] [info] [client 127.0.0.1] mod_wsgi (pid=25387, process='streetbooking.com', application='www.streetbooking.com|'): Loading WSGI script '/home/daninma/webapps/django1_2_1/streetbooking/prod_django.wsgi'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25382): Shutdown requested 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25382): Stopping process 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25382): Destroying interpreters.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25382): Destroy interpreter 'www.impromptudo.com|'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25383): Shutdown requested 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25383): Stopping process 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25383): Destroying interpreters.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25383): Destroy interpreter 'www.impromptudo.com|'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25384): Shutdown requested 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25384): Stopping process 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25384): Destroying interpreters.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25382): Cleanup interpreter ''.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25385): Shutdown requested 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25384): Destroy interpreter 'www.impromptudo.com|'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25385): Stopping process 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25385): Destroying interpreters.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25385): Destroy interpreter 'www.impromptudo.com|'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25383): Cleanup interpreter ''.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25382): Terminating Python.
[Thu May 12 14:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25386): Shutdown requested 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25387): Shutdown requested 'streetbooking.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25386): Stopping process 'impromptudo.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25388): Shutdown requested 'streetbooking.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25388): Stopping process 'streetbooking.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25388): Destroying interpreters.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25388): Destroy interpreter 'www.streetbooking.com|'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25384): Cleanup interpreter ''.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25383): Terminating Python.
[Thu May 12 14:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25385): Cleanup interpreter ''.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25389): Shutdown requested 'streetbooking.com'.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25389): Stopping process 'streetbooking.com'.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25389): Destroying interpreters.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25389): Cleanup interpreter ''.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25390): Shutdown requested 'streetbooking.com'.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25391): Shutdown requested 'streetbooking.com'.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25392): Destroying interpreters.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25392): Cleanup interpreter ''.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25387): Stopping process 'streetbooking.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25386): Destroying interpreters.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25386): Destroy interpreter 'www.impromptudo.com|'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25387): Destroying interpreters.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25387): Destroy interpreter 'www.streetbooking.com|'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25384): Terminating Python.
[Thu May 12 14:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25385): Terminating Python.
[Thu May 12 14:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25389): Terminating Python.
[Thu May 12 13:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25392): Terminating Python.
[Thu May 12 13:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25390): Stopping process 'streetbooking.com'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25390): Destroying interpreters.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25390): Destroy interpreter 'www.streetbooking.com|'.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25388): Cleanup interpreter ''.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25389): Python has shutdown.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25392): Python has shutdown.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25391): Stopping process 'streetbooking.com'.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25391): Destroying interpreters.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25391): Cleanup interpreter ''.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25387): Cleanup interpreter ''.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25386): Cleanup interpreter ''.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25382): Python has shutdown.
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25391): Terminating Python.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25383): Python has shutdown.
[Thu May 12 13:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25387): Terminating Python.
[Thu May 12 14:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25386): Terminating Python.
[Thu May 12 14:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 13:07:06 2011] [info] mod_wsgi (pid=25391): Python has shutdown.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25384): Python has shutdown.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25388): Terminating Python.
[Thu May 12 14:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25390): Cleanup interpreter ''.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25385): Python has shutdown.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25390): Terminating Python.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25387): Python has shutdown.
[Thu May 12 14:07:06 2011] [error] Exception KeyError: KeyError(-1208555840,) in <module 'threading' from '/usr/local/lib/python2.6/threading.pyc'> ignored
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25388): Python has shutdown.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25386): Python has shutdown.
[Thu May 12 14:07:06 2011] [info] mod_wsgi (pid=25390): Python has shutdown.
[Thu May 12 13:07:06 2011] [info] removed PID file /home/daninma/webapps/django1_2_1/apache2/logs/httpd.pid (pid=25381)
[Thu May 12 13:07:06 2011] [notice] caught SIGTERM, shutting down

I also think I am noticing a pattern. When this happens and I am ssh'd in to my webfaction account, the ssh session terminates at the same time...

asked 12 May '11, 11:16

DanInMA
112
accept rate: 0%

edited 12 May '11, 13:12

Could you turn on DEBUG for this application? It should be able to print the full traceback to the screen, rather than barf a rather useless error message into your logs.

(12 May '11, 11:25) David L ♦♦

Done. Will post back when it happens again.

(12 May '11, 11:36) DanInMA

It happened again, nothing different in the log though. just the same KeyError messages and then the SIGTERM...

I've also added LogLevel debug to apache httpd.conf

(12 May '11, 12:11) DanInMA

please see update.

(12 May '11, 13:59) DanInMA

Your processes are being terminated several times daily because of excessive memory usage. We haven't sent any notifications to you recently because the notifications we've sent to you in the past have not been marked as resolved. If you want to be notified the next time it happens, then go to your message list in the control panel and mark your older memory-related messages as resolved.

permanent link

answered 12 May '11, 15:11

seanf
12.2k41836
accept rate: 37%

Done, thanks. Is there anything I can do to profile my applications to see where I am using so much memory that the processes are being killed multiple times a day?

(12 May '11, 18:12) DanInMA

You can monitor your usage following these docs http://docs.webfaction.com/software/general.html?highlight=memory#monitoring-memory-usage.

And using http://docs.webfaction.com/software/general.html?highlight=memory#reducing-memory-usage should help you reduce your memory usage.

(12 May '11, 20:53) bmeyer71 ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×225
×62
×2

question asked: 12 May '11, 11:16

question was seen: 4,817 times

last updated: 12 May '11, 20:53

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM