XF 2.3 Slow file download - Xenforo Resource / XFRM

nco

New member
Hello everyone,

I use Xenforo and the Xenforo Forum Resource Manager extension in which I upload resources from 1 to 3 GB. I manage to upload these resources, but when I download them : They start downloading at several Megabytes/s, then drop to a few Kilobytes/s as the download progresses. A 1.5GB resource takes over an hour to download.

If I don't go through Xenforo, but upload the same resource to the web server and then access it as a direct link. The resource downloads quickly at around ~10mo/s. I don't notice any loss of download speed (2-5 minutes to download)

Bandwidth is good and stable. It has no configured limitations.

Have any of you experienced this problem? Do you have any suggestions?

Thank you in advance for your help.

Additional information :
Code:
XenForo v2.3.4
PHP version    8.3.14
MySQL version    8.0.39 
Server software    Apache/2.4.39
PHP memory_limit    128M
PHP post_max_size    20M
PHP upload_max_filesize    20M
PHP max_input_vars    75000
PHP max_execution_time    30
 
Hello,

I'm continuing my research, but the problem is still there. Since the direct link download works quickly, I suspect a PHP block. Today, I changed the Apache/PHP configuration with no noticeable results:

Code:
PHP memory_limit    512M
PHP post_max_size    4G
PHP upload_max_filesize    4G
PHP max_input_vars    75000
PHP max_execution_time    600

Some people experiencing slow downloads mention a parameter to be enabled in Apache: : EnableSendfile

  • Do you think it would make sense?
  • Do you have any other solutions I could try out?

Thanks in advance
 
Hello everyone,

I'm starting to wonder if Xenforo is able to efficiently handle file downloads up to 1GB. When logging slow PHP requests, I see the following lines when downloading a file :

Code:
[31-Jan-2025 15:49:02]  [pool test.com] pid 91
script_filename = //var/www/htdocs/test.com/index.php
[0x00007f5352a13320] fpassthru() /var/www/htdocs/test.com/src/XF/Http/ResponseStream.php:34
[0x00007f5352a132b0] output() /var/www/htdocs/test.com/src/XF/Http/Response.php:475
[0x00007f5352a13220] sendBody() /var/www/htdocs/test.com/src/XF/Http/Response.php:293
[0x00007f5352a131c0] send() /var/www/htdocs/test.com/src/XF.php:856
[0x00007f5352a130c0] runApp() /var/www/htdocs/test.com/index.php:23

I have increased the server's RAM resources to 8GB for testing purposes, disabled add-on. This does not solve my problem.

Perhaps, I can get confirmation from the XenForo team @Jeremy P or a community member that a 2GB file can be downloaded without any problems? This would confirm to me that continuing my research makes sense.

Thank you in advance for your help.
 
Perhaps, I can get confirmation from the XenForo team @Jeremy P or a community member that a 2GB file can be downloaded without any problems? This would confirm to me that continuing my research makes sense.
Just tested downloading a 2GB file and it took less than 30 seconds, though it was via Nginx/PHP-FPM and not Apache/mod_php. Are you using any attachment storage provider (S3 etc.)?
 
I have 10GB per file, works flawless last 5 years without any problem, even google drive speed bounces, but downloads from my own server are stable 10MBPS.

PHP memory_limit5000M
PHP post_max_size10000M
PHP upload_max_filesize10000M
PHP max_input_vars1000
PHP max_execution_time6000

slow download happened twice: 1 hosting did update network & 2 firewall blocked some ips.


XF has nothing to do with that!
 
Hello,

Firstly, thank you very much for your feedback. I have confirmation that it is indeed possible to download large files via xenforo.

Just tested downloading a 2GB file and it took less than 30 seconds, though it was via Nginx/PHP-FPM and not Apache/mod_php. Are you using any attachment storage provider (S3 etc.)?

No, we don't use a storage provider. However, we use a GlusterFS storage volume.

  1. Do you think the download slowdowns may have something to do with this ?
  2. Could you provide your PHP configuration for this type of download @Jeremy P (PHP memory_limit,PHP post_max_size, PHP upload_max_filesize, PHP max_input_vars, PHP max_execution_time) ?
  3. Are there any solutions for monitoring slow downloads in XF or Apache?
I have 10GB per file, works flawless last 5 years without any problem, even google drive speed bounces, but downloads from my own server are stable 10MBPS.

PHP memory_limit5000M
PHP post_max_size10000M
PHP upload_max_filesize10000M
PHP max_input_vars1000
PHP max_execution_time6000

slow download happened twice: 1 hosting did update network & 2 firewall blocked some ips.


XF has nothing to do with that!


Thank for your share. Does your web server run under apache/php-fpm @javakhir ?


Thank you in advance for your help.
 
Hello everybody,

I've made a further observation. Heavy files download quickly (~ 1min) from the administration panel (content > attachment > XYZ file).
The same resource takes over an hour to download from XenForo Resource Manager. (slowdown during download).

Notice that download endpoint is not the same :
  • XFRM download link: /index.php?resources/test-public-1-go-file.199/download
  • Download link from admin panel : /admin.php?attachments/test_file_1go-zip.1712/view
Do you have any ideas about the causes of this problem @Jeremy P ?
 
Last edited:
Could you provide your PHP configuration for this type of download @Jeremy P
1738785800674.webp

Only post_max_size and upload_max_filesize should make any difference, and that's only to upload and not to download.

Do you have any ideas about the causes of this problem @Jeremy P ?
That's an interesting clue, though they ultimately use the same code and I can't reproduce a difference locally.
 
Back
Top Bottom