New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing Nginx temporary buffer default location #1423

MoffTigriss opened this Issue Nov 21, 2018 · 4 comments


None yet
6 participants
Copy link

MoffTigriss commented Nov 21, 2018

On my first installation, I used a iSCSI mount for /var/www/peertube/storage. My objective was to use a Freenas installation, sharing a large volume via iSCSI, for easy backups, future moving, and playing with decentralized redundancy.

The partitioning for the Debian host was small. And sometimes, videos stopped during upload, at different progression time. No sign of anything on the system, and the filesystem indicated free space.

Nginx use a temporary file in /var/lib/nginx/body/ to store the upload buffer. The file is not visible, because listed as "deleted" in file descriptors. You can view the current file, when uploading, with sudo lsof -p NGINXPID, and the size increasing. When finished, the file is moved to the upload location. If nginx stop the upload process or crash, the file is immediately lost, so there is no remains, whatever happen.

Having a, potentially, <= 8GB file not documented somewhere on the filesystem can be a problem with small installs. And even more if you/guest upload multiple videos at the same time.


Nginx allow the relocation of that temporary folder, in a location context with the directive client_body_temp_path, so it can be configured specifically for location / :

Moving the cache folder somewhere in /var/www/peertube/.cache/ or /var/www/peertube/storage/cache/ will allow to keep big files in the same place, and not having problem with a small install/partitioning.

Current installs works fine, but changing the default configuration and update the documentation to reflect where Nginx create his buffer could be nice for future users.


This comment has been minimized.

Copy link

Nutomic commented Nov 21, 2018

Great find! You should make a PR to set this path in the sample Nginx config.

It might also be a good idea to put this in /var/www/peertube/storage/videos/uploads or so, for people like me who only mount the video folder with a large partition.


This comment has been minimized.

Copy link

JohnXLivingston commented Nov 22, 2018

Have you any idea about this issue ? #1359
I think it can be related to this kind of nginx configuration. (it is on a slow VM... only one CPU)


This comment has been minimized.

Copy link

Nutomic commented Nov 22, 2018

@JohnXLivingston Sorry no idea, I didn't hear about any problems with uploading on my instance (it's on a fast SSD).


This comment has been minimized.

Copy link

iwascraig commented Jan 15, 2019

I have this problem also .. not related to CPU size.. the problem is related to upload file size...
my /var/lib/nginx/body folder is on a system volume that is only 10GB in size... when I try to upload a 15GB file (research data, often this large or larger) I run out of space and client gets error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment