Deployment Flashcards
What is a server?
A server handles requests and sends back some sort of reponse. In order to do so, a server is designed with much more processing speed, storage, and RAM
What are some web server components?
Server side:
1) Web Server - The web server receives a request from the client. The web server asks the logic unit to retrieve some content
2) Application - The logic unit receives requests from the web server. Its job is to run appropriate segments of your code according to the request’s instructions. If that code requires information from the database, the logic unit will retrieve that data before organizing it and sending back a response to the web server.
3) The database is simply a file or a container for document storage like your computer’s hard-drive. Its sole purpose is to store files, update files, and retrieve files according to instructions received from the interpreter.
What is the process manager (green unicorn)?
Roles are:
1) Restart the app automatically if it crashes
2) Gain insights into runtime performance and resource consumption
3) Modify settings dynamically to improve performance
4) Load balancing
What does gunicorn do?
Gunicorn is designed to handle incoming requests that will need to be routed to the interpreter. This includes any route you’ve added to urls.py . We’ll learn more about our other server, Nginx, which will be serving static files such as images
How does gunicorn interat with your Django app?
WSGI.py is the created when you start a project. It;’s the glue that connects your Django app with gunicorn.
Local environments?
Chances are that when you deploy an app you’ve been developing in a local environment, you need to use some kind of process manager, regardless of the technology stack. Some common combinations include Unicon for Rails, pm2 for NodeJS, and Apache for PHP.
Three basic functions you will need to set up whn you add Gunic
To add Gunicorn functionality:
1) needs to know which socket to connect to
2) what do to if a process fails
3) How many workers to setup
Armed with these instructions, Gunicorn takes over the job of ensuring that your app keeps running if an error occurs, directing traffic to the appropriate port, and running concurrent processes. In short, Gunicorn makes sure your deployment server runs more smoothly