Downloading 30mb file kills Concrete5

Permalink
When I try download a 30mb file from our site, it temporarily kills Concrete5 while the file is downloading.

So for several minutes the site is completely useless and frozen until the file has finished downloading. You can't go to any other page - it looks like the server is not responding.

After the download is finished, the site regains consciousness and runs fine.

We can't go live with our site like this. We can't have the site die every time someone downloads files.

I have tested this with two separate hosting companies, one running Concrete 5.4.2 and the other running 5.4.1.1.

Need to get this resolved URGENTLY - anyone know how to fix this?

 
Mnkras replied on at Permalink Reply
Mnkras
I don't think that is c5, I have 100mb+ files, and the site works fine,
hivoltage replied on at Permalink Reply
Nope, I do believe it's a C5 issue - spoke to the hosting company and they verified there's a php script running the entire time the download is taking place therefore slowing down the entire site.

What version are you running? What's your site and file? I'd like to test it out.
Mnkras replied on at Permalink Reply
Mnkras
Iv tested on 5.4.1.1 and 5.4.2,

make sure your server has enough resources to send the download, I bet that is the issue,
hivoltage replied on at Permalink Reply
what resources will it need? I'll go check.
hivoltage replied on at Permalink Reply
I checked the php settings:

max_execution_time = 30
max_input_time = 60
memory_limit = 32M

These are the only values I can see via cPanel. Are these sufficient? Any other settings I should check?
hivoltage replied on at Permalink Reply
It is a C5 issue because if I download the file using c5's inbuilt download scripts it kills the site - if I download the file directly (i.e. using the full path to the file ../file/4234/2343/4556/FileName), it downloads fine and doesn't kill the site.

So it definitely is a c5 issue.

Unfortunately there's no easy way to specify the full path to the file in c5 and we have to use the c5 file manager to specify the file dynamic path.

Any ideas how to fix this?
hostco replied on at Permalink Reply
hostco
Upload your files to the /files/incoming directory. Then import them into your file manager from there.
hivoltage replied on at Permalink Reply
not sure why? how does this affect download performance?
hostco replied on at Permalink Reply
hostco
Its just something else to try. If your site is freezing when someone downloads a file, it is your hosting environment for sure not concrete5.

One other thing you could do is create a directory like /downloads and upload your files there.

From there create static links to the files using the c5 html editor.

Then the files would have nothing to do with the file manager.
hivoltage replied on at Permalink Reply
yeah I suppose I can have a static link to a download folder like you mentioned - I'll save this for last if I can't get the dynamic downloads to work.

If it's the hosting environment, what resources will the site need? Memory is set to 32mb - is this enough?
Mnkras replied on at Permalink Reply
Mnkras
Ill look into the code a bit more tomorrow,
hivoltage replied on at Permalink Reply
I had the hosting company up the RAM to 64mb from 32mb and this made no difference what so ever.

Downloading files still kills the site.
hivoltage replied on at Permalink Reply
I can confirm that this is a concrete issue and not a server issue.

I have tested this on Concrete5.org own site - I downloaded Concrete5 and it hangs the entire site during the download and releases as soon as you cancel or finish the download.

It's not my site. It's not our hosting environment. It's definitely Concrete5 that's the problem.

I have tried this on both Safari and Firefox. I am a Mac user (but I doubt that's the issue). I tried hosting it on our own server here and had someone externally test it and same problem - so this makes 3 servers we've tried it on PLUS concrete5's own site.
andrew replied on at Permalink Reply
andrew
A couple things.

It does not kill the whole site. It does, however, make your session temporarily unavailable. You can verify this by opening a separate browser and hitting your site while the download takes place. The downloading browser will be unavailable to browse the site. The other browser will be fine.

This isn't great, obviously, but I recently discovered a simple fix for this. Try forking your download script and adding



somewhere in it. Preferably as close to the end before the download commences as possible.
andrew replied on at Permalink Reply
andrew
Update: I added this to the concrete file helper on concrete5.org, in concrete/helpers/file.php, at the beginning of the forceDownload($file) function and it seems to be helping concrete5.org.
hostco replied on at Permalink Reply
hostco
I was not able to reproduce the error because I was testing it from a separate browser. Good find hivoltage.

Thanks for the fast fix Andrew.