From e11ae55ed935dbc08164e2af254b70054c0e6fef Mon Sep 17 00:00:00 2001 From: TinyAtoms Date: Sat, 1 Aug 2020 23:51:34 -0300 Subject: [PATCH] deployment, and some load testing --- CalibreWebCompanion/db_routers/routers.py | 2 + CalibreWebCompanion/gunicorn.conf.py | 19 +++++ .../library/context_processors.py | 2 + CalibreWebCompanion/library/forms.py | 2 + CalibreWebCompanion/library/models.py | 2 + CalibreWebCompanion/library/urls.py | 2 + CalibreWebCompanion/library/views.py | 2 + deployment/instructions.md | 11 ++- deployment/nginx.conf | 2 +- loadtesting/calibre_failures.csv | 3 +- loadtesting/calibre_stats.csv | 40 +++++----- loadtesting/calibre_stats_history.csv | 75 +++++++++++++++---- loadtesting/locust.conf | 4 +- loadtesting/locustfile.py | 2 +- requirements.txt | 1 + 15 files changed, 127 insertions(+), 42 deletions(-) create mode 100644 CalibreWebCompanion/gunicorn.conf.py diff --git a/CalibreWebCompanion/db_routers/routers.py b/CalibreWebCompanion/db_routers/routers.py index 5048712..f465cff 100644 --- a/CalibreWebCompanion/db_routers/routers.py +++ b/CalibreWebCompanion/db_routers/routers.py @@ -1,4 +1,6 @@ +import logging +logger = logging.getLogger(__name__) class DjangoRouter: """ diff --git a/CalibreWebCompanion/gunicorn.conf.py b/CalibreWebCompanion/gunicorn.conf.py new file mode 100644 index 0000000..4659b22 --- /dev/null +++ b/CalibreWebCompanion/gunicorn.conf.py @@ -0,0 +1,19 @@ +import multiprocessing + +bind = "127.0.0.1:8000" +workers = multiprocessing.cpu_count() * 2 + 1 +preload_app = True # By preloading an application you can save some RAM resources as well as speed up server boot times +keepalive = 5 +# daemon = True # Detaches the server from the controlling terminal and enters the background. disabled for now +# logging +errorlog = "/home/massiveatoms/Desktop/logs/gunicorn.log" +loglevel = "warning" + + +# debug settings which need to be commented out in prod +# reload=True +# reload_engine = "inotify" + + +# I only went till the section https://docs.gunicorn.org/en/latest/settings.html#logging there are more settings +# some of them might be useful \ No newline at end of file diff --git a/CalibreWebCompanion/library/context_processors.py b/CalibreWebCompanion/library/context_processors.py index 584a6ed..b2fb1af 100644 --- a/CalibreWebCompanion/library/context_processors.py +++ b/CalibreWebCompanion/library/context_processors.py @@ -1,6 +1,8 @@ from .models import Author, Tag, Publisher, Language, Rating, Series from django.db.models import Count +import logging +logger = logging.getLogger(__name__) def filters(request): # unique_authors = Author.objects.all().order_by('sort') diff --git a/CalibreWebCompanion/library/forms.py b/CalibreWebCompanion/library/forms.py index 910d3b0..f629bad 100644 --- a/CalibreWebCompanion/library/forms.py +++ b/CalibreWebCompanion/library/forms.py @@ -1,7 +1,9 @@ from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User +import logging +logger = logging.getLogger(__name__) class SearchForm(forms.Form): title = forms.CharField(label="Title", max_length=200) diff --git a/CalibreWebCompanion/library/models.py b/CalibreWebCompanion/library/models.py index 744829b..5992513 100644 --- a/CalibreWebCompanion/library/models.py +++ b/CalibreWebCompanion/library/models.py @@ -8,7 +8,9 @@ from django.db import models from django.urls import reverse from django.utils.functional import cached_property +import logging +logger = logging.getLogger(__name__) class Author(models.Model): name = models.TextField() diff --git a/CalibreWebCompanion/library/urls.py b/CalibreWebCompanion/library/urls.py index de06834..8a961a7 100644 --- a/CalibreWebCompanion/library/urls.py +++ b/CalibreWebCompanion/library/urls.py @@ -1,7 +1,9 @@ from django.urls import path from . import views from django.views.decorators.cache import cache_page +import logging +logger = logging.getLogger(__name__) urlpatterns = [ path('authors/', views.AuthorListView.as_view(), name='authors'), diff --git a/CalibreWebCompanion/library/views.py b/CalibreWebCompanion/library/views.py index 9021868..62128ba 100644 --- a/CalibreWebCompanion/library/views.py +++ b/CalibreWebCompanion/library/views.py @@ -8,7 +8,9 @@ from django.db.models import Q from django.contrib.auth.models import User from django.contrib.auth import login from django.contrib.auth.decorators import login_required +import logging +logger = logging.getLogger(__name__) # might be helpful for vary headers later from django.utils.decorators import method_decorator diff --git a/deployment/instructions.md b/deployment/instructions.md index 0c96fb7..3baa749 100644 --- a/deployment/instructions.md +++ b/deployment/instructions.md @@ -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 \ No newline at end of file +3. autostart gunicorn/nginx +4. some extra instrumentation for gunicorn https://docs.gunicorn.org/en/latest/deploy.html \ No newline at end of file diff --git a/deployment/nginx.conf b/deployment/nginx.conf index a8a55e7..bdcc1ec 100644 --- a/deployment/nginx.conf +++ b/deployment/nginx.conf @@ -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 { diff --git a/loadtesting/calibre_failures.csv b/loadtesting/calibre_failures.csv index b275500..8e298b3 100644 --- a/loadtesting/calibre_failures.csv +++ b/loadtesting/calibre_failures.csv @@ -1 +1,2 @@ -Method,Name,Error,Occurrences +Method,Name,Error,Occurrences +GET,/book/,500 Server Error: Internal Server Error for url: /book/,3 diff --git a/loadtesting/calibre_stats.csv b/loadtesting/calibre_stats.csv index 72b9e2f..f46b1d0 100644 --- a/loadtesting/calibre_stats.csv +++ b/loadtesting/calibre_stats.csv @@ -1,20 +1,20 @@ -Type,Name,Request Count,Failure Count,Median Response Time,Average Response Time,Min Response Time,Max Response Time,Average Content Size,Requests/s,Failures/s,50%,66%,75%,80%,90%,95%,98%,99%,99.9%,99.99%,99.999%,100% -GET,/accounts/login/,20,0,36,59.85466241836548,14.995336532592773,151.90577507019043,2024.0,0.8592061926044773,0.0,41,72,110,120,140,150,150,150,150,150,150,150 -POST,/accounts/login/,20,0,540.0,504.5383930206299,198.87518882751465,746.5388774871826,61528.8,0.8592061926044773,0.0,560,580,600,600,680,750,750,750,750,750,750,750 -GET,/author/,5,0,37,57.76419639587402,28.97953987121582,138.9150619506836,25477.6,0.21480154815111932,0.0,37,53,53,140,140,140,140,140,140,140,140,140 -GET,/authors/,8,0,49,45.841872692108154,3.998994827270508,121.92440032958984,30653.75,0.3436824770417909,0.0,50,50,73,73,120,120,120,120,120,120,120,120 -GET,/book/,8,0,31,44.84483599662781,22.98569679260254,111.92703247070312,15194.75,0.3436824770417909,0.0,37,42,55,55,110,110,110,110,110,110,110,110 -GET,/books/,10,0,6,13.889431953430176,3.998994827270508,51.969289779663086,54841.6,0.42960309630223864,0.0,7,11,17,28,52,52,52,52,52,52,52,52 -GET,/publisher/,9,0,46,47.74824778238932,32.979726791381836,68.95899772644043,27992.444444444445,0.3866427866720148,0.0,46,52,53,63,69,69,69,69,69,69,69,69 -GET,/publishers/,7,0,33,27.697699410574778,4.996776580810547,51.969289779663086,25000.14285714286,0.30072216741156704,0.0,33,37,39,39,52,52,52,52,52,52,52,52 -GET,/rating/,8,0,66,77.861487865448,44.24405097961426,121.92630767822266,39245.375,0.3436824770417909,0.0,68,110,120,120,120,120,120,120,120,120,120,120 -GET,/ratings/,8,0,26,34.85342860221863,3.9975643157958984,69.95558738708496,26850.75,0.3436824770417909,0.0,34,42,56,56,70,70,70,70,70,70,70,70 -GET,/search/,11,0,26,27.622352946888316,11.99197769165039,51.96666717529297,27841.454545454544,0.4725634059324625,0.0,26,30,34,34,44,52,52,52,52,52,52,52 -GET,/series/,8,0,26,31.429588794708252,3.9980411529541016,53.01809310913086,20345.375,0.3436824770417909,0.0,34,50,52,52,53,53,53,53,53,53,53,53 -GET,/tag/,7,0,43,50.228118896484375,33.979177474975586,73.95386695861816,27211.85714285714,0.30072216741156704,0.0,43,54,71,71,74,74,74,74,74,74,74,74 -GET,/tags/,5,0,56,61.562395095825195,14.991283416748047,119.92549896240234,31376.8,0.21480154815111932,0.0,56,83,83,120,120,120,120,120,120,120,120,120 -GET,search_by_author,7,0,37,46.945163181849885,21.98958396911621,138.9153003692627,26497.571428571428,0.30072216741156704,0.0,37,39,45,45,140,140,140,140,140,140,140,140 -GET,search_by_identifier,9,0,38,55.72432941860623,28.980731964111328,174.89361763000488,30605.11111111111,0.3866427866720148,0.0,38,38,47,67,170,170,170,170,170,170,170,170 -GET,search_by_title,7,0,38,48.82873807634626,22.993087768554688,101.93872451782227,30429.571428571428,0.30072216741156704,0.0,38,53,62,62,100,100,100,100,100,100,100,100 -GET,search_generic,13,0,39,41.35936957139235,11.992692947387695,96.94075584411621,22713.076923076922,0.5584840251929102,0.0,39,49,54,62,62,97,97,97,97,97,97,97 -,Aggregated,170,0,40,99.35710009406594,3.9975643157958984,746.5388774871826,29734.95294117647,7.303252637138057,0.0,41,53,70,110,380,580,600,680,750,750,750,750 +Type,Name,Request Count,Failure Count,Median Response Time,Average Response Time,Min Response Time,Max Response Time,Average Content Size,Requests/s,Failures/s,50%,66%,75%,80%,90%,95%,98%,99%,99.9%,99.99%,99.999%,100% +GET,/accounts/login/,20,0,15,14.807796478271484,8.188486099243164,21.71945571899414,2024.0,0.16739911642581679,0.0,16,17,18,18,20,22,22,22,22,22,22,22 +POST,/accounts/login/,20,0,320.0,335.94770431518555,302.3109436035156,504.45032119750977,76378.0,0.16739911642581679,0.0,330,340,340,350,370,500,500,500,500,500,500,500 +GET,/author/,40,0,27,27.45213508605957,20.0350284576416,67.98744201660156,30708.725,0.33479823285163357,0.0,27,28,29,29,32,34,68,68,68,68,68,68 +GET,/authors/,53,0,33,32.4410987350176,3.3960342407226562,151.21984481811523,39339.0,0.4436076585284145,0.0,33,33,35,36,43,47,73,150,150,150,150,150 +GET,/book/,63,3,31,30.65679186866397,20.604372024536133,50.59003829956055,30451.74603174603,0.5273072167413229,0.025109867463872518,31,32,33,33,35,37,37,51,51,51,51,51 +GET,/books/,42,0,130.0,110.17770994277228,3.3218860626220703,274.7330665588379,76378.0,0.3515381444942153,0.0,130,130,130,140,160,190,270,270,270,270,270,270 +GET,/publisher/,48,0,27,26.85883641242981,17.744064331054688,69.56601142883301,30890.270833333332,0.4017578794219603,0.0,27,27,29,29,31,34,70,70,70,70,70,70 +GET,/publishers/,40,0,24,22.84235954284668,4.957437515258789,34.004926681518555,33158.0,0.33479823285163357,0.0,24,26,27,27,28,31,34,34,34,34,34,34 +GET,/rating/,53,0,30,36.589348091269436,9.972572326660156,93.70565414428711,35127.301886792455,0.4436076585284145,0.0,30,40,46,51,57,68,85,94,94,94,94,94 +GET,/ratings/,42,0,23,21.207468850272043,6.12950325012207,37.114858627319336,30028.0,0.3515381444942153,0.0,23,23,24,24,26,28,37,37,37,37,37,37 +GET,/search/,54,0,17,15.807677198339391,3.0889511108398438,24.329662322998047,30164.0,0.45197761434970535,0.0,18,19,20,21,22,23,23,24,24,24,24,24 +GET,/series/,44,0,20,19.72411437468095,5.149126052856445,28.244972229003906,29798.0,0.3682780561367969,0.0,21,23,23,24,25,26,28,28,28,28,28,28 +GET,/tag/,45,0,26,26.674440171983505,16.248226165771484,37.3835563659668,31041.577777777777,0.3766480119580878,0.0,26,27,28,29,30,35,37,37,37,37,37,37 +GET,/tags/,45,0,32,29.666270150078667,3.5097599029541016,77.78573036193848,38073.0,0.3766480119580878,0.0,32,32,33,34,36,39,78,78,78,78,78,78 +GET,search_by_author,55,0,22,22.336192564530805,12.028932571411133,51.23710632324219,30187.963636363635,0.4603475701709962,0.0,22,24,24,25,28,30,30,51,51,51,51,51 +GET,search_by_identifier,45,0,26,24.89140298631456,17.200946807861328,34.82961654663086,30556.533333333333,0.3766480119580878,0.0,26,27,27,28,30,31,35,35,35,35,35,35 +GET,search_by_title,43,0,26,24.867362754289495,12.270927429199219,32.17816352844238,30419.883720930233,0.35990810031550613,0.0,26,27,27,28,29,30,32,32,32,32,32,32 +GET,search_generic,62,0,26,26.363442021031535,16.860246658325195,69.95797157287598,30512.548387096773,0.518937260920032,0.0,26,27,28,28,32,34,38,70,70,70,70,70 +,Aggregated,814,3,26,37.75617238637563,3.0889511108398438,504.45032119750977,34674.45577395577,6.813144038530743,0.025109867463872518,26,28,31,32,43,130,310,330,500,500,500,500 diff --git a/loadtesting/calibre_stats_history.csv b/loadtesting/calibre_stats_history.csv index 9781b5a..ebb3547 100644 --- a/loadtesting/calibre_stats_history.csv +++ b/loadtesting/calibre_stats_history.csv @@ -1,15 +1,62 @@ "Timestamp","User Count","Type","Name","Requests/s","Failures/s","50%","66%","75%","80%","90%","95%","98%","99%","99.9%","99.99%","99.999%","100%","Total Request Count","Total Failure Count","Total Median Response Time","Total Average Response Time","Total Min Response Time","Total Max Response Time","Total Average Content Size" -"1594960389","0","","Aggregated",0.00,0.00,"N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A",0,0,0,0,0,0,0 -"1594960391","1","","Aggregated",0.00,0.00,"N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A",0,0,0,0,0,0,0 -"1594960394","5","","Aggregated",0.00,0.00,36,150,470,590,600,680,680,680,680,680,680,680,13,0,36,210,5,680,37214 -"1594960396","9","","Aggregated",4.33,0.00,45,150,460,470,590,600,680,680,680,680,680,680,23,0,45,185,5,680,30962 -"1594960398","13","","Aggregated",4.25,0.00,50,110,200,380,560,600,680,680,680,680,680,680,41,0,50,165,4,680,32896 -"1594960400","17","","Aggregated",5.86,0.00,53,110,200,460,580,600,680,750,750,750,750,750,62,0,52,175,4,746,34112 -"1594960402","20","","Aggregated",6.50,0.00,54,110,150,300,580,600,680,750,750,750,750,750,83,0,53,157,4,746,31425 -"1594960404","20","","Aggregated",7.40,0.00,52,74,120,140,540,580,680,750,750,750,750,750,96,0,50,145,4,746,32075 -"1594960406","20","","Aggregated",8.30,0.00,49,70,110,140,440,580,600,750,750,750,750,750,110,0,49,132,4,746,30740 -"1594960408","20","","Aggregated",8.40,0.00,41,52,71,100,140,490,580,600,600,600,600,600,123,0,45,124,4,746,30477 -"1594960410","20","","Aggregated",8.20,0.00,39,50,54,66,120,140,440,580,580,580,580,580,135,0,44,117,4,746,30262 -"1594960412","20","","Aggregated",7.20,0.00,37,43,52,54,73,120,120,120,120,120,120,120,147,0,43,110,3,746,30003 -"1594960414","20","","Aggregated",6.30,0.00,37,45,52,53,67,110,120,120,120,120,120,120,164,0,42,102,3,746,29411 -"1594960415","0","","Aggregated",6.80,0.00,34,42,49,52,63,73,120,120,120,120,120,120,170,0,40,99,3,746,29734 +"1596336131","1","","Aggregated",0.00,0.00,"N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A","N/A",0,0,0,0,0,0,0 +"1596336133","4","","Aggregated",0.00,0.00,18,19,300,300,330,330,330,330,330,330,330,330,12,0,18,115,8,333,37040 +"1596336135","8","","Aggregated",6.00,0.00,19,22,300,320,330,330,340,340,340,340,340,340,26,0,19,110,8,344,36889 +"1596336137","12","","Aggregated",6.00,0.00,22,28,300,320,330,350,370,370,370,370,370,370,45,0,22,104,3,373,37421 +"1596336139","16","","Aggregated",7.33,0.00,23,28,190,310,330,350,370,370,370,370,370,370,63,0,23,99,3,373,37468 +"1596336141","20","","Aggregated",7.14,0.00,23,27,51,310,330,340,370,370,370,370,370,370,80,0,23,94,3,373,36325 +"1596336143","20","","Aggregated",8.00,0.00,26,30,51,270,330,350,370,500,500,500,500,500,96,0,24,91,3,504,36582 +"1596336145","20","","Aggregated",8.30,0.00,26,30,32,40,310,340,370,500,500,500,500,500,111,0,26,82,3,504,35951 +"1596336147","20","","Aggregated",8.60,0.00,27,30,32,35,270,340,370,500,500,500,500,500,127,0,25,76,3,504,35750 +"1596336149","20","","Aggregated",7.90,0.00,27,31,33,36,130,270,340,500,500,500,500,500,140,0,26,73,3,504,35941 +"1596336151","20","","Aggregated",7.90,0.00,27,31,34,35,44,130,150,240,240,240,240,240,153,0,26,72,3,504,35966 +"1596336153","20","","Aggregated",7.10,0.00,28,33,35,36,78,130,150,240,240,240,240,240,168,0,26,69,3,504,36026 +"1596336155","20","","Aggregated",7.30,0.00,28,33,36,36,78,130,150,240,240,240,240,240,177,0,26,67,3,504,35843 +"1596336157","20","","Aggregated",7.30,0.00,28,34,36,36,78,130,150,240,240,240,240,240,188,1,26,64,3,504,35397 +"1596336159","20","","Aggregated",6.50,0.10,26,32,35,36,78,140,150,240,240,240,240,240,205,1,26,62,3,504,35527 +"1596336161","20","","Aggregated",6.50,0.10,26,29,33,35,47,73,130,140,140,140,140,140,218,1,26,60,3,504,35650 +"1596336163","20","","Aggregated",6.60,0.10,25,27,29,32,35,68,140,160,160,160,160,160,235,1,26,58,3,504,35495 +"1596336165","20","","Aggregated",6.60,0.10,26,28,32,33,42,130,140,160,160,160,160,160,244,1,26,57,3,504,35601 +"1596336167","20","","Aggregated",6.70,0.10,26,29,32,33,55,130,130,160,160,160,160,160,255,2,26,56,3,504,35369 +"1596336169","20","","Aggregated",6.60,0.10,26,29,32,32,43,58,130,160,160,160,160,160,269,2,26,54,3,504,35229 +"1596336171","20","","Aggregated",6.40,0.10,26,28,31,32,39,55,58,130,130,130,130,130,284,2,26,53,3,504,35026 +"1596336173","20","","Aggregated",6.70,0.10,26,29,31,32,39,58,130,130,130,130,130,130,296,2,26,52,3,504,35030 +"1596336175","20","","Aggregated",6.10,0.10,26,29,31,32,35,55,130,130,130,130,130,130,310,2,26,51,3,504,34991 +"1596336177","20","","Aggregated",6.40,0.10,25,29,30,31,35,51,130,130,130,130,130,130,320,2,26,50,3,504,34890 +"1596336179","20","","Aggregated",6.50,0.00,25,28,29,30,33,120,130,130,130,130,130,130,336,2,26,49,3,504,34830 +"1596336181","20","","Aggregated",6.70,0.00,26,27,29,30,33,44,130,140,140,140,140,140,351,2,26,48,3,504,34829 +"1596336183","20","","Aggregated",6.10,0.00,25,27,29,30,35,94,130,140,140,140,140,140,363,2,26,48,3,504,34787 +"1596336185","20","","Aggregated",6.70,0.00,26,28,29,30,37,120,150,190,190,190,190,190,378,2,26,48,3,504,34880 +"1596336187","20","","Aggregated",6.40,0.00,26,28,30,33,85,130,150,190,190,190,190,190,391,2,26,47,3,504,34874 +"1596336189","20","","Aggregated",6.80,0.00,27,29,33,34,94,140,150,190,190,190,190,190,400,2,26,47,3,504,34951 +"1596336191","20","","Aggregated",6.60,0.00,27,28,32,33,46,130,150,190,190,190,190,190,417,2,26,46,3,504,34925 +"1596336193","20","","Aggregated",6.90,0.00,26,28,29,31,37,85,130,130,130,130,130,130,430,2,26,46,3,504,34937 +"1596336195","20","","Aggregated",6.60,0.00,26,29,30,32,46,120,130,130,130,130,130,130,443,2,26,45,3,504,34959 +"1596336197","20","","Aggregated",6.60,0.00,26,28,29,30,35,46,120,130,130,130,130,130,454,2,26,45,3,504,34988 +"1596336199","20","","Aggregated",6.50,0.00,26,28,29,30,32,37,120,130,130,130,130,130,473,2,26,44,3,504,34866 +"1596336201","20","","Aggregated",7.10,0.00,26,28,29,30,32,35,120,130,130,130,130,130,485,2,26,44,3,504,34795 +"1596336203","20","","Aggregated",6.80,0.00,26,29,30,30,32,33,34,38,38,38,38,38,501,2,26,43,3,504,34747 +"1596336205","20","","Aggregated",7.20,0.00,27,29,30,31,32,33,34,43,43,43,43,43,512,2,26,43,3,504,34754 +"1596336207","20","","Aggregated",7.10,0.00,27,28,30,32,33,40,56,130,130,130,130,130,529,2,26,42,3,504,34777 +"1596336209","20","","Aggregated",7.20,0.00,27,29,32,33,40,57,130,130,130,130,130,130,541,2,26,42,3,504,34936 +"1596336211","20","","Aggregated",6.80,0.00,27,29,32,33,43,130,130,130,130,130,130,130,554,2,26,42,3,504,34959 +"1596336213","20","","Aggregated",7.10,0.00,27,29,32,33,57,130,130,130,130,130,130,130,572,2,26,42,3,504,35016 +"1596336215","20","","Aggregated",6.90,0.00,27,28,31,33,57,130,130,130,130,130,130,130,579,2,26,42,3,504,34976 +"1596336217","20","","Aggregated",6.80,0.00,27,28,31,32,50,130,130,130,130,130,130,130,594,2,26,41,3,504,34913 +"1596336219","20","","Aggregated",6.70,0.00,27,27,29,31,45,120,130,140,140,140,140,140,613,2,26,41,3,504,34870 +"1596336221","20","","Aggregated",6.70,0.00,26,27,28,29,32,46,130,140,140,140,140,140,625,2,26,41,3,504,34803 +"1596336223","20","","Aggregated",6.80,0.00,25,27,28,30,32,33,50,140,140,140,140,140,638,2,26,40,3,504,34731 +"1596336225","20","","Aggregated",6.80,0.00,25,27,30,31,32,33,50,140,140,140,140,140,648,2,26,40,3,504,34695 +"1596336227","20","","Aggregated",6.80,0.00,26,27,31,31,33,34,36,140,140,140,140,140,663,2,26,40,3,504,34632 +"1596336229","20","","Aggregated",6.70,0.00,26,28,31,32,34,36,36,44,44,44,44,44,673,2,26,40,3,504,34673 +"1596336231","20","","Aggregated",6.60,0.00,26,29,31,33,35,36,44,120,120,120,120,120,687,2,26,39,3,504,34659 +"1596336233","20","","Aggregated",6.40,0.00,27,29,31,33,35,44,68,120,120,120,120,120,698,2,26,39,3,504,34624 +"1596336235","20","","Aggregated",5.90,0.00,26,28,30,32,35,56,120,120,120,120,120,120,714,2,26,39,3,504,34690 +"1596336237","20","","Aggregated",6.30,0.00,26,28,30,32,44,120,120,130,130,130,130,130,724,2,26,39,3,504,34719 +"1596336239","20","","Aggregated",6.00,0.00,24,27,28,30,34,56,120,130,130,130,130,130,737,2,26,39,3,504,34667 +"1596336241","20","","Aggregated",6.20,0.00,24,27,28,29,34,68,120,130,130,130,130,130,750,2,26,38,3,504,34630 +"1596336243","20","","Aggregated",6.20,0.00,24,26,27,28,31,36,58,130,130,130,130,130,765,2,26,38,3,504,34688 +"1596336245","20","","Aggregated",6.90,0.00,24,26,28,28,32,36,58,130,130,130,130,130,778,2,26,38,3,504,34700 +"1596336247","20","","Aggregated",6.50,0.00,25,27,28,30,34,37,58,130,130,130,130,130,790,3,26,38,3,504,34677 +"1596336249","20","","Aggregated",6.70,0.10,25,27,30,31,34,37,58,130,130,130,130,130,802,3,26,38,3,504,34713 +"1596336250","0","","Aggregated",6.10,0.10,24,27,29,30,33,37,58,130,130,130,130,130,814,3,26,37,3,504,34674 diff --git a/loadtesting/locust.conf b/loadtesting/locust.conf index ada3077..2caa71c 100644 --- a/loadtesting/locust.conf +++ b/loadtesting/locust.conf @@ -1,6 +1,6 @@ locustfile = locustfile.py -expect-workers = 50 -host = http://127.0.0.1:8000 +expect-workers = 200 +host = http://localhost users = 20 hatch-rate = 2 run-time = 2m diff --git a/loadtesting/locustfile.py b/loadtesting/locustfile.py index 748e162..4fc8a67 100644 --- a/loadtesting/locustfile.py +++ b/loadtesting/locustfile.py @@ -8,7 +8,7 @@ import json # -------------------------------- fetching data to test with with open("./../CalibreWebCompanion/settings.json", "r") as jfile: - calpath = json.load(jfile)["CALIBRE_DIR"] + "\\metadata.db" + calpath = json.load(jfile)["CALIBRE_DIR"] + "/metadata.db" with open("dummyusers.json", "r") as jfile: users = json.load(jfile) diff --git a/requirements.txt b/requirements.txt index e34616b..b465ba0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ django>=3.0.8 +inotify>=0.2.10 # development django-debug-toolbar>=2.2 django-silk>=4.0