Closed offtherailz closed 7 years ago
Can we get the value for the defaultStreamByteSize config param?
Is it set?
The default does not seem reasonable to me (1KB) and it might slown down large responses parsing.
I think this is part of (or all) the problem:
Basically we read all the response in memory and then we flush it to the servlet output stream. I would simply remove the bytearrayoutputstream usage.
Good catch Mauro.
I think we need to:
Applying the fixes I noticed that the issue not visible in my local env. I suppose the issue is visible in production because of some bottleneck in networking from the http-proxy point of view (It can be reading the response or sending it back to the client) that can be anyway multiplied by the issue I fixed.
Compared results with local proxy
So not any appreciable difference between normal and proxy request.
note: The response starts in late for the proxy version.
Proxy response timing without fix :
Of course the same for the fixes applied:
(note: of course we can not see the difference between normal request and proxy request, so we don't expect any improvement from our changes in local tests.
But it starts to write the response before:
I suggest to add my changes anyway, to improve the response timing, and then see it they reduce the problem, what do you think?
note I changed the buffer size in local, but of course nothing changed, I will not commit it, I'd like to do some tests in dev env instead, to see if it improves the performances too.
Well, the writing above is not extremely clear to me.
Anyway, I would go ahead, incorporate my suggestions and do the merge.
With large responses it is a waste of memory to load everything before proxying!
Example: body
To this URL :
http://demo.geo-solutions.it/geoserver/ows?service=WFS&outputFormat=application/json&
thakes 247msUsing the proxy:
http://lhtac.geo-solutions.it/lhtac-webgis/proxy/?url=http%3A%2F%2Fdemo.geo-solutions.it%2Fgeoserver%2Fows%3Fservice%3DWFS%26outputFormat%3Dapplication%2Fjson
Takes 6156 ms:
This is the full HTTP request: