深度阅读

uvicorn限制并发数目

作者
作者
2023年08月22日
更新时间
7.65 分钟
阅读时间
0
阅读量

并发虽然好,内存爆掉也很无奈

Resource Limits

限制并发
- --limit-concurrency <int> - Maximum number of concurrent connections or tasks to allow, before issuing HTTP 503 responses. Useful for ensuring known memory usage patterns even under over-resourced loads.

限制最多请求
- --limit-max-requests <int> - Maximum number of requests to service before terminating the process. Useful when running together with a process manager, for preventing memory leaks from impacting long-running processes.
- --backlog <int> - Maximum number of connections to hold in backlog. Relevant for heavy incoming traffic. Default: 2048

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。