You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the maxContentLength length option axios needs an ever growing amount of resources to download data and impacts the network stack of NodeJS in general (e.g. db modules loose their connection/can't establish a connection). This occurs especially with bigger files and multiple tasks. It takes sometime until the effect is visible. In short: more CPU, more RAM, less throughput.
To Reproduce
Code snippet to be run with nodejs:
importaxiosfrom'axios';asyncfunctionstart(){consturls=['https://releases.ubuntu.com/20.04.2.0/ubuntu-20.04.2.0-desktop-amd64.iso?_ga=2.75943062.262255550.1619531518-988591408.1619531518','https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-10.9.0-arm64-xfce-CD-1.iso','http://ftp.tu-chemnitz.de/pub/linux/centos/8.3.2011/isos/x86_64/CentOS-8.3.2011-x86_64-dvd1.iso','http://ftp.tu-chemnitz.de/pub/linux/centos/8.3.2011/isos/x86_64/CentOS-8.3.2011-x86_64-minimal.iso','http://ftp.antilo.de/pub/linux/centos/8.3.2011/isos/x86_64/CentOS-8.3.2011-x86_64-minimal.iso','http://centos.intergenia.de/8.3.2011/isos/x86_64/CentOS-8.3.2011-x86_64-minimal.iso'];constpromises=urls.map((url)=>axios.get(url,{maxContentLength: 4000000000,// ca. 3.7GB}));awaitPromise.all(promises);console.log('finish');}start();
Overhead with maxContentLength was fixed in #3738 PR.
It's incredible that the lineBuffer.concat (responseBuffer) .length> config.maxContentLength could have been in the codebase of a project like this for years. This is very painful for a perfectionist nature :)
Describe the bug
When using the
maxContentLength
length option axios needs an ever growing amount of resources to download data and impacts the network stack of NodeJS in general (e.g. db modules loose their connection/can't establish a connection). This occurs especially with bigger files and multiple tasks. It takes sometime until the effect is visible. In short: more CPU, more RAM, less throughput.To Reproduce
Code snippet to be run with nodejs:
GitHub Repo: https://github.com/Benedikt1992/axios-bug
Expected behavior
No negative (or less) impact on the resource consumption compared to the performance without
maxContentLength
.Environment
Additional context/Screenshots
The text was updated successfully, but these errors were encountered: