MinIO 默认情况下,服务器/集群同时处理的并发请求数没有限制。但是,可以使用 API 子系统强加此类限制。如下:
KEY: api manage global HTTP API call specific features, such as throttling, authentication types, etc. 管理全局 HTTP API 调用特定功能,例如限制、身份验证类型等。 ARGS: requests_max (number) set the maximum number of concurrent requests, e.g. "1600" 设置最大并发请求数 requests_deadline (duration) set the deadline for API requests waiting to be processed e.g. "1m" 设置等待处理的 API 请求的截止日期 cors_allow_origin (csv) set comma separated list of origins allowed for CORS requests e.g. "https://example1.com,https://example2.com" 设置允许 CORS 请求的逗号分隔的来源列表 remote_transport_deadline (duration) set the deadline for API requests on remote transports while proxying between federated instances e.g. "2h" 在联合实例之间进行代理时,为远程传输上的 API 请求设置截止日期
通过修改 .minio.sys/config/config.json 文件来实现,如下:
{ //... "api": { "_": [{ "key": "requests_max", "value": "0" }, { "key": "requests_deadline", "value": "10s" }, { "key": "cluster_deadline", "value": "10s" }, { "key": "cors_allow_origin", "value": "*" }, { "key": "remote_transport_deadline", "value": "2h" }, { "key": "list_quorum", "value": "optimal" }, { "key": "extend_list_cache_life", "value": "0s" }, { "key": "replication_workers", "value": "250" }, { "key": "replication_failed_workers", "value": "8" } ] }, //... }
当然,也可以通过环境变量进行控制。如下:
MINIO_API_REQUESTS_MAX (number) set the maximum number of concurrent requests, e.g. "1600" MINIO_API_REQUESTS_DEADLINE (duration) set the deadline for API requests waiting to be processed e.g. "1m" MINIO_API_CORS_ALLOW_ORIGIN (csv) set comma separated list of origins allowed for CORS requests e.g. "https://example1.com,https://example2.com" MINIO_API_REMOTE_TRANSPORT_DEADLINE (duration) set the deadline for API requests on remote transports while proxying between federated instances e.g. "2h"