Bird
0
0

You deployed a Flask app but users report it crashes under load. You notice you used app.run() directly on the server. What is the most likely cause?

medium📝 Debug Q6 of 15
Flask - Deployment
You deployed a Flask app but users report it crashes under load. You notice you used app.run() directly on the server. What is the most likely cause?
AThe app is missing a database connection
BFlask's built-in server is single-threaded and not suitable for production
CThe app has debug mode enabled
DThe app is missing a route for '/'
Step-by-Step Solution
Solution:
  1. Step 1: Identify Flask's built-in server limitations

    Flask's built-in server is single-threaded and not designed for heavy traffic.
  2. Step 2: Connect server crash to load handling

    Under load, the server cannot handle multiple requests, causing crashes.
  3. Final Answer:

    Flask's built-in server is single-threaded and not suitable for production -> Option B
  4. Quick Check:

    Server crash cause = B [OK]
Quick Trick: Use a production WSGI server to handle load [OK]
Common Mistakes:
MISTAKES
  • Blaming missing database connection
  • Assuming debug mode causes crashes under load
  • Thinking missing route causes server crash

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes