X
X
ximtej2015-11-23 15:38:38
PHP
ximtej, 2015-11-23 15:38:38

How to make Apache friends and upload large files?

I'm writing a small file hosting service. Everything works, but Apache hangs when trying to upload large files to the server.
There is a web server with 3 GB of RAM. At the same time trying to upload 2 files of 2 GB to it via http, Apache hangs. It is treated only by reboot. As far as I understand, the downloaded files clog the RAM, which is why the hang occurs.
There is a suspicion that some setting is responsible for this, and Apache, in theory, can save the file in parts without clogging the RAM.
I will be glad to any advice. Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2015-11-23
@OnYourLips

I didn't just post the question. There is a problem, which is that sometimes 2 different people with old browsers upload large files to the server, as a result of which my service stops working until a reboot. It is impossible to argue with this fact, but a solution must be found.

ximtej : with this question, I would simply increase the amount of RAM to 8-16GB. Cheaper than redoing the code.
If this is not possible, then you need to upload files through a web server.
For example, the upload module in nginx (I don’t understand apache, IMHO it has long been outdated).
As a result, $_FILES in PHP will be empty, and only the path to the file loaded by the web server will come.
Memory will not be wasted even with 100 parallel downloads per terabyte.

K
kompi, 2015-11-23
@kompi

Put a normal web server that can unbuffered upload.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question