mirror of https://github.com/jumpserver/jumpserver
perf: 优化 host api 和 gunicorn 参数
parent
7b9c4b300d
commit
daef154622
|
@ -122,8 +122,12 @@ class AssetViewSet(SuggestionMixin, NodeFilterMixin, OrgBulkModelViewSet):
|
|||
]
|
||||
|
||||
def get_queryset(self):
|
||||
return super().get_queryset().prefetch_related('nodes', 'protocols')\
|
||||
queryset = super().get_queryset() \
|
||||
.prefetch_related('nodes', 'protocols') \
|
||||
.select_related('platform', 'domain')
|
||||
if queryset.model is not Asset:
|
||||
queryset = queryset.select_related('asset_ptr')
|
||||
return queryset
|
||||
|
||||
def get_serializer_class(self):
|
||||
cls = super().get_serializer_class()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from ..hands import *
|
||||
from .base import BaseService
|
||||
from ..hands import *
|
||||
|
||||
__all__ = ['GunicornService']
|
||||
|
||||
|
@ -22,7 +22,7 @@ class GunicornService(BaseService):
|
|||
'-b', bind,
|
||||
'-k', 'uvicorn.workers.UvicornWorker',
|
||||
'-w', str(self.worker),
|
||||
'--max-requests', '4096',
|
||||
'--max-requests', '40960',
|
||||
'--access-logformat', log_format,
|
||||
'--access-logfile', '-'
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue