sonatype/nexus-oss — pull request #116 by cstamas (2013-09-10 07:15:09+00:00)
Title: NEXUS-5790: Download speeds reduced in recent versions of Nx

This is a manual port of the change from master, that is functionally similar, but not the same of the change in master (wannabe 2.7.0) where whole content resource got reimplemented.

This change below is basically the 1st set of changes I did on master (before deciding to reimplement complete content resource). Main problem with Nexus is that it used default buffer size from Plexus Utils (4KB), while Jetty from going to 6.x to 8.x included a responseBufferSize change from 24KB (in 6.x) to 32KB (in 8.x).

This change contains two notable things:
a) buffer size raised to 16KB
b) buffer size exposed and is configurable via `org.sonatype.nexus.rest.StorageFileItemRepresentation.BUFFER_SIZE` system property (in bytes)
c) in case of bundle, Jetty response buffer size was always configurable via `jetty.xml`

Recommended setup is to "align" Nexus and Jetty response buffer sizes (as then 1:1 copy will be happening). Still, don't forget these are byte array buffers, hence, are taken from heap. In large instance, the increase from 4KB to 16KB (or even 32KB) might be too steep without heap size increase (would need some analysis).

Issue
https://issues.sonatype.org/browse/NEXUS-5790

CI
https://bamboo.zion.sonatype.com/browse/NX-OSSF15