Very New to kubernetes and Traefik, I'm using traefik 2.2.1, and when I try to upload a big file (like 800MB), it is very slow, took 15mins complete this. I change the memRequestBodyBytes to 2000000000, it still slow. Is there any issue my configuration ?
Give the configure like this:
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: test-middleware
spec:
chain:
middlewares:
- name: prefix-middleware
- name: limit
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
creationTimestamp: null
name: prefix-middleware
spec:
stripPrefix:
prefixes:
- /stripit
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: limit
spec:
buffering:
memRequestBodyBytes: 2000000000
It's hard to tell exactly why you are experiencing that kind of behavior without the necessary details but I have some possible solutions that you and the rest of the community might find useful.
The memRequestBodyBytes
only lets you choose the size of the threshold from which the request will be buffered on disk instead of in memory. Instead, I would rather look at the RateLimit and make sure that it is not limiting your performance.
Looking at the issue from the Kubernetes side, it is worth checking if your Traefik deployment have a proper resource constraints. For example:
...
resources:
limits:
cpu: 400m
memory: 100Mi
requests:
cpu: 400m
memory: 100Mi
...
Setting them high enough (or removing the completely) will improve the performance.
If that would still be not enough, you need to check your maximum upload speed from the ISP side. Because based on the data you provided, it would take a 800 MB file to upload in 15 min if you have ~7 Mpbs upload speed.
Please let me know if that helped.