Comments (18)
@spencergibb We're currently rewriting a gateway app in Spring Cloud Gateway which was previously implemented using Zuul, and its been fun to say the least! This issue though is one of interest to us as we near completion, because in zuul it was possible to prepend a "/zuul/" prefix to a route which caused a different servlet to be used, tailored for large file transfers. We're wondering if that's the intention here too, or similar, or should we not wait and go away and find our own solution for large file streaming outside our gateway app? Currently we're finding that large files are completely memory bound (which we assume is what this issue was raised to address? ), so any feedback would be appreciated.
from spring-cloud-gateway.
@admoriarty there should be no limitation here since this is not using servlets. This issue is to verify assumptions using a test.
from spring-cloud-gateway.
Thanks @spencergibb we'll have to have a closer look at what we're doing...will report back if we find anything specific malfunctioning :)
from spring-cloud-gateway.
@spencergibb We parked our work for a while, but just recently brought our app up to date with the latest milestone releases and everything works a charm except for large uploads. 10MB and 50MB pass though the gateway fine, a 200MB file resulted in an OOM - io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 637534215, max: 643301376)
Obviously we could provide the app with more memory but clearly this approach isn't right, it shouldn't be buffering these files in memory at all, and as I said earlier in zuul we were able to use the /zuul prefix path to avoid this. Should we just not be passing such content through this gateway at all and find another handler for it?
from spring-cloud-gateway.
Is there any progress on this? We would like to update a legacy project to Spring Boot 2 , get rid of Zuul and use the Gateway but large file uploads are a big theme for us.
Any ETA or more details on outstanding issues? Is it just about waiting on reactor-netty to fix something?
from spring-cloud-gateway.
@spencergibb Is this the same issue? #171
from spring-cloud-gateway.
No
from spring-cloud-gateway.
@spencergibb Do you need someone to work on a test?
from spring-cloud-gateway.
Help is allways appreciated
from spring-cloud-gateway.
Is this issue has solution?
from spring-cloud-gateway.
If it did it would have been closed.
from spring-cloud-gateway.
If at any time you have a stacktrace similar to this:
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1793)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
at com.netflix.zuul.http.HttpServletRequestWrapper.parseRequest(HttpServletRequestWrapper.java:151)
You know you are doing it wrong. The problem with copying the content of a request like that is the whole request is in memory. That's a problem for file uploads, and small files like 40-50MB can kill the the gateway if you get enough of those requests in a short period of time (i.e. during ETL). The gateway should only stream data from the incoming request straight to it's destination with only a handful of bytes in memory at a time for any given request.
Running into this issue with production right now.
from spring-cloud-gateway.
@bericoberin, this is not the repo for zuul
from spring-cloud-gateway.
do we have a sollution for large file upload now?
from spring-cloud-gateway.
Hi,
do we have a sollution for large file upload nd download ?
it seems that gateway's performance only influenced by response body size, with bigger than about 10kb size [https://github.com//issues/301]
Thanks
Youcef HILEM
from spring-cloud-gateway.
If anyone has a problem uploading large files, can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
from spring-cloud-gateway.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
from spring-cloud-gateway.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
from spring-cloud-gateway.
Related Issues (20)
- Migrate mvc proxy exchange properties to new namespace and deprecate old
- Migrate webflux proxy exchange properties to new namespace and deprecate old
- Migrate server-webflux properties to new namespace and deprecate old
- Migrate server-webmvc properties to new namespace and deprecate old
- Serve Single Page Applications as static files in Spring Cloud Gateway HOT 5
- Custom GlobalFilter will have undeterministic hehavior when the Order is the same value. HOT 3
- openfeign java.lang.NoClassDefFoundError: feign/Request$Options
- Route pointing to self can be bypassed by direct controller access
- Cors handling with spring cloudgateway mvc HOT 1
- SCG Redis ratelimiter solution has unavailable issues when redis has problems HOT 3
- How can i block"/actuator" endpoint in gateway HOT 3
- can anyone provide a spring-cloud-gateway-mvc sample? HOT 2
- LEAK: ByteBuf.release() error HOT 6
- The cache works differently if the value of local-response-cache.enabled is default false or explicitly false
- Load balance per route read timeout in spring-cloud-gateway-server-mvc HOT 1
- Ratelimiter not working with aws elasticache redis 7.1 HOT 10
- Gateway MVC ServerRequest body broken when created from another
- Required Gobalfilter type interface in Spring Cloud Gateway MVC, and instead of bean creation properties level routes configuration HOT 2
- direct memory always increases when adding custom filter to get request body size
- Spring Cloud Gateway not allowing Encoded URL paths after Update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-cloud-gateway.