WebFaction
Community site: login faq

Hey all,

Thanks a lot for reading. At our highest traffic points about once or twice per day, our (Django on Webfaction) site is crashing and requires Apache to be restarted in order to get going again. The rest of the time it works normally.

Webfaction has said that it is not a case of overrunning our allowed memory usage or else they would notify us. One thing we tried is setting up SMTP to make sure error notifications come through via e-mail (http://sontek.net/exception-occurred-processing-wsgi-script) - they are now coming through successfully, but this did not appear to be the cause (small number of errors/timing doesn't coincide with crashes.)

Is it possible that certain requests are hanging? Should I set up a timeout value or a script to auto-restart - and if so, how/what do you recommend?

Thanks a lot!

asked 12 Oct '11, 12:15

ersflocab
111
accept rate: 0%


Bugs like this can be tough to track down.

Bugs that cause infinite loops or infinite waiting and similar bugs that cause Apache to 'hang' may not always be logged.

It is good you have e-mail logging enabled as it can sometimes catch bugs that will not go to the server log. I would look at every error in e-mail extra carefully, I personally have had errors that at first seemed like they had nothing to do with an issue however after I isolated the problem it turned out they were.

A common cause of issues like this is version mismatches is libraries(especially if they are from trunk repos), and those cases will have bugs that may not look related but are.

A bottleneck in your database queries or the processing that happens in the views can also cause an issue such as this.

What is difficult at this point is trying to gain more information. There are some basic things to check first,

Does your code need any external resources or APIs? If so are they timing out?

Does your code make any complex or large database queries? You can use Django Debug Toolbar To find more info on what is being ran per page.

I would not suggest you solve the issue by setting an automatic restart as that will cause downtime for everyone at some point in the day anyway, defeating the purpose.

You should be able to track down the issue if you can isolate what causes it exactly. Once you know what requests and how many cause a problem, than you can monitor your database queries and other resources at that time and see what is happening.

permanent link

answered 12 Oct '11, 17:27

johns
5.4k312
accept rate: 23%

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
×26
×3

question asked: 12 Oct '11, 12:15

question was seen: 4,636 times

last updated: 12 Oct '11, 17:27

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