在同步 django 应用程序中调用长时间运行的服务

问题描述 投票:0回答:0

我有一个 Django 休息框架应用程序使用选项

gunicorn
--workers=1
以同步模式运行。该应用程序有一个通过 http 调用外部服务的 api 方法。该服务响应了很长时间。所以我的整个应用程序被阻止,直到收到响应。我有哪些选项可以使应用程序不被该服务阻止?我考虑过缓存,但它不是很有用,因为请求不同。

performance asynchronous django-rest-framework gunicorn
© www.soinside.com 2019 - 2024. All rights reserved.