deployment, and some load testing

This commit is contained in:
TinyAtoms
2020-08-01 23:51:34 -03:00
parent 5182b2cdb6
commit e11ae55ed9
15 changed files with 127 additions and 42 deletions

View File

@@ -2,16 +2,21 @@
1. clone repo
2. pip install -r requirements.txt
3. install gunicorn and nginx
4. move this nginx.conf to /etc/nginx (as of now, it's not working)
4. move this nginx.conf to /etc/nginx
5. make whatever user nginx runs as (in this case, massiveatoms) the owner of calibredir
6. give execute permissions to parent of calibredir
7. cd to repo, run `gunicorn -w <2x n cores/threads> CalibreWebCompanion.wsgi`
8. start nginx `sudo systemctl restart nginx`
Slight issues with this atm:
1. allowed host in settings.json needs to have the ip/host/thing it will be used, as does line 47 from nginx.conf
2. User might need to be edited in nginx.conf, now it's just my user acc. This affectd step 4-6
2. User needs to be edited in nginx.conf, now it's just my user acc. This affectd step 4-6
3. logging location of nginx and gunicorn need to be changed. gunicorn in ./CalibreWebCompanion/gunicorn.conf.py and nginx in the conf
4.
Suggestions:
1. We might want to use sockets instead of ip/port?
2. logging
3. autostart gunicorn/nginx
3. autostart gunicorn/nginx
4. some extra instrumentation for gunicorn https://docs.gunicorn.org/en/latest/deploy.html

View File

@@ -3,7 +3,7 @@ worker_processes 1;
# user nobody nogroup;
user massiveatoms; # MASSIVEATOMS
# user nobody nobody; # for systems with 'nobody' as a group instead
error_log /var/log/nginx/error.log warn;
error_log /home/massiveatoms/Desktop/logs/nginx.log warn;
# pid /var/run/nginx.pid;
events {