You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/11/29 08:48:32 UTC

[GitHub] [servicecomb-kie] five111 opened a new issue #229: 请问关于配额设计是如何考虑的 以及如何修改配额

five111 opened a new issue #229:
URL: https://github.com/apache/servicecomb-kie/issues/229


   ```
   func PreCreate(service, domain, project, resource string, number int64) error {
   	if defaultManager == nil {
   		openlog.Debug("quota management not available")
   		return nil
   	}
   	qs, err := defaultManager.GetQuotas(service, domain, project)
   	if err != nil {
   		openlog.Error(err.Error())
   		return ErrGetFailed
   	}
   	var resourceQuota *Quota
   	for _, q := range qs {
   		if q.ResourceName == resource {
   			resourceQuota = q
   			break
   		}
   	}
   	if resourceQuota == nil {
   		//no limits
   		openlog.Debug("no limits for " + resource)
   		return nil
   	}
   	if number > resourceQuota.Limit-resourceQuota.Used {
   		return ErrReached
   	}
   	return nil
   }
   ```
   配额的维度是和 service , domain, project 相关的
   这里的domain和project可以说是从请求参数中读取的
   但是service这个 从命名来看是和服务挂钩的,这个维度在请求时该如何体现
   做性能测试时 发现默认最大就10000, 这个配额该如何配置?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] five111 edited a comment on issue #229: 请问关于配额设计是如何考虑的 以及如何修改配额

Posted by GitBox <gi...@apache.org>.
five111 edited a comment on issue #229:
URL: https://github.com/apache/servicecomb-kie/issues/229#issuecomment-981411033


   补充一下 这边的实现是否需要考虑原子性 配额10000  我实际已经插入进去的配置为10082
   ```
   {
   	"version": "0.1.0",
   	"revision": "10094",
   	"timestamp": 1638175900,
   	"total_kv_count": 10082
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] tianxiaoliang edited a comment on issue #229: 请问关于配额设计是如何考虑的 以及如何修改配额

Posted by GitBox <gi...@apache.org>.
tianxiaoliang edited a comment on issue #229:
URL: https://github.com/apache/servicecomb-kie/issues/229#issuecomment-983376709


   the impl is in here https://github.com/apache/servicecomb-kie/blob/master/server/plugin/qms/quota.go.
   
   which means you can use env param to set quota.
   
   would you like to contribute the doc?
   
   quota managment will not introduce eventual consistency problem ,the answer is no, we will not gurantee that


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] tianxiaoliang commented on issue #229: 请问关于配额设计是如何考虑的 以及如何修改配额

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on issue #229:
URL: https://github.com/apache/servicecomb-kie/issues/229#issuecomment-983376709


   the impl is in here https://github.com/apache/servicecomb-kie/blob/master/server/plugin/qms/quota.go.
   
   which means you can use env param to set quota.
   
   would you like to contribute the doc?
   
   quota managment will not introduce eventual consistency problem ,the answer is no, we will 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-kie] five111 commented on issue #229: 请问关于配额设计是如何考虑的 以及如何修改配额

Posted by GitBox <gi...@apache.org>.
five111 commented on issue #229:
URL: https://github.com/apache/servicecomb-kie/issues/229#issuecomment-981411033


   补充一下 这边的实现是否需要考虑原子性 配额10000  我实际已经插入进去的配置为10094
   ```
   {
   	"version": "0.1.0",
   	"revision": "10094",
   	"timestamp": 1638175900,
   	"total_kv_count": 10082
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org