-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResourceExhausted error when creating many HTTPPipelines and HTTPServer paths #413
Comments
It seems etcd default max allowed sending message size is 2.0 MiB (which is 2097152). And we send messages beyond this size. In https://github.com/etcd-io/etcd/blob/e2d67f2e3bfa6f72178e26557bb22cc1482c418c/client/v3/config.go, In https://etcd.io/docs/v3.1/upgrades/upgrade_3_3/, they have a example:
By now I am not sure this size is for transaction or for single operation. (I think it's for single operation). One way to solve this problem is to add an option to allow users to change "MaxCallSendMsgSize" for etcd client. And etcd recommendedMaxRequestBytes is 10 MiB (10 * 1024 * 1024). Any idea here? |
This is a good idea, that way the downstream applications and end users can choose appropriate value for Would server configurations name: machine-1
cluster-name: easegress-cluster
cluster-role: primary
...
cluster:
listen-peer-urls:
- http://HOST1:2380
listen-client-urls:
- http://HOST1:2379
advertise-client-urls:
- http://HOST1:2379
initial-advertise-peer-urls:
- http://HOST1:2380
initial-cluster:
- machine-1: http://HOST1:2380
maxMessageSize: 10MiB <---------------- NEW LINE |
I don't think it is an easy task for end user to choose an appropriate value for what the process will be to update the configuration to a good one? Will it be very difficult as primary Easegress nodes are a statefulset? My idea (I'm not sure if it is possible by now) is: could we detect this error at runtime, and recreate the ETCD client with a larger |
Since this happens really rare (only happen when yaml file with thousands of lines). So, when this happens, can we create a tmp etcd client with |
It's not especially difficult; there seems to be few ways to patch Statefulset. But I agree that it's difficult to choose the good initial value.
I have more fancy idea: if we reach the ETCD message limit, let's multiply the limit by a constant (1.25 for example) and then let's try again with higher limit. Repeat this until there is no more this specific Of course setting the limit to very high (10MiB) right away or after first |
I like the idea to increase the size limit at runtime, and is it possible to get the desired limit from the error message (grep the error message is not a good way because the format may change)? If yes, then we don't need to repeat the process and try again. But I'm also fine with adding a new configuration item if automatically increase the limit is too difficult to implement, as we can patch a Statefulset. |
How about we calculate the size of message when etcd client return an error? If it exceed 2.0MiB, we may create a new etcd client based on the message size and then do the resend (if the message size is bigger than 10MiB we may log an error). But first we need to figure out that this |
Dynamically changing argument seems too complex for me, why must we do that instead of giving a bigger default message size. |
Yeah, maybe we make this problem too complex, if change |
Change parameters dynamically is more user friendly, even we add a option, people may raise the same issue later because it is a low level configuration. |
When a single message exceed 10+ MiB, that's not the issue only about dynamic or static adjustment, but an architecture-level problem(and we should be happy about it if it happened since it will be running a lot of things in very big size) |
Ok, then I'm fine with a larger default value. |
Describe the bug
Easegress server throws
2021-12-16T03:40:40.8Z ERROR statussynccontroller/statussynccontroller.go:217 sync status failed: rpc error: code = ResourceExhausted desc = trying to send message larger than max (2274303 vs. 2097152)
when creating 1000 dummy HTTPPipelines and one HTTPServer with one backend rule for each pipeline.To Reproduce
Steps to reproduce the behavior:
name: pipeline-$i
. Run the second script provided below:bash generate_pipeline.sh > pipelines.yaml
bash generate_server.sh > httpserver.yaml
bin/easegress-server
bin/easegress-server object create -f pipelines.yaml
bin/easegress-server object create -f httpserver.yaml
Expected behavior
Easegress-server should not fail when creating (many) objects.
Version
1.4.0
Configuration
Easegress Configuration
Default parameters.
HTTP server configuration
The following bash script generates the server HTTPServer:
The following bash script generates the pipeline:
Logs
This is the output of easegress-server when the error happens:
OS and Hardware
The text was updated successfully, but these errors were encountered: