Speed up file serving with webserver

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Speed up file serving with webserver

Postby matrixebiz » 27. September 2017 13:16

Good Day, just wondering if there are some settings that will speed up the file serving when server load seems to get higher? My Windows 2016 server is a streaming server and I've noticed that when the bandwidth traffic gets under load the streaming of the files is slowed way down.
I tried to use IIS 10 but that program seems to have a limit on the amount of files it can stream at one time so some users are unable to get the files when many users are streaming so that is no good.
Any setting I can change in Xampp Apache to make it the fastest possible when streaming 1000+ files at a time? Thanks
matrixebiz
 
Posts: 12
Joined: 09. August 2017 19:47
XAMPP version: 7.1.7
Operating System: Windows Server 2016

Re: Speed up file serving with webserver

Postby matrixebiz » 27. September 2017 18:06

My bandwidth doing a speedtest.net on the server is around;
700 Mbps D and 200 Mbps U

Would these settings help me that I read off another thread from 2011?

httpd.conf

open your \xampp\conf\httpd.conf file
search for #EnableSendfile off
remove the # at the beginning
save the file

Regedit

HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > AFD > Parameters

You need to create TWO DWORD values "DefaultReceiveWindow" and "DefaultSendWindow"

You then set both these values using DECIMAL (not Hex) using this formula:

DefaultReceiveWindow = (Download Capacity in Kilobits * 1024) / 8
DefaultSendWindow = (Upload Capacity in Kilobits * 1024) / 8

For example, for a 10Mbit (10000Kbit) upload and download:

DefaultReceiveWindow = (10000 * 1024) / 8 = 1280000
DefaultSendWindow = (10000 * 1024) / 8 = 1280000
matrixebiz
 
Posts: 12
Joined: 09. August 2017 19:47
XAMPP version: 7.1.7
Operating System: Windows Server 2016

Re: Speed up file serving with webserver

Postby gsmith » 28. September 2017 03:15

matrixebiz wrote:httpd.conf

open your \xampp\conf\httpd.conf file
search for #EnableSendfile off
remove the # at the beginning
save the file


Unlike 2.2, the default for EnableSendfile in 2.4 defaults to "off" so simply uncommenting this isn't going to change anything.

That said, because of the now off default large files tend to not complete and the visitor gets a partial because Apache buffers the entire file in RAM before sending. The size which is sent varies depending on the system. For this reason I set EnableSenfile to On for certain file types like .iso and mp4, anything over ~100MB on my server.

It might speed up your streaming because with EnableSenfile On Apache lets the OS send the file instead, or it may not speed it up at all. You'll have to test. I would not turn it on globally however, my testing of it made a mess of small files which is probably why EnableSendfile's default was changed in 2.4.

Code: Select all
<Files ~ "(\.ico|.mp4|.mov|.flv)$">
EnableSendfile On
</Files>

I can't speak on the registry tweaks if needed or not.
gsmith
 
Posts: 214
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win XP to 2012R2/VS 6,9,11,14

Re: Speed up file serving with webserver

Postby matrixebiz » 28. September 2017 11:56

Thanks for responding, so I guess because my files are maximum 5 MB this option wont do anything for me then :( It's when traffic gets under load, streaming is slowed.
matrixebiz
 
Posts: 12
Joined: 09. August 2017 19:47
XAMPP version: 7.1.7
Operating System: Windows Server 2016

Re: Speed up file serving with webserver

Postby Nobbie » 28. September 2017 12:25

matrixebiz wrote:Any setting I can change in Xampp Apache to make it the fastest possible when streaming 1000+ files at a time? Thanks


1000+ files AT A TIME??

I dont think that this is possible with even one simple server. 1000 files is a huge amount in every aspect, probably each file is streamed by its own process (a fork of apache?) and needs certain amount of ressources (RAM, Cache, etc.). I dont think that a simple PC can handle 1000+ streams at a time without serious performance issues. Youtube & Co. are using large arrays of servers to establish streaming of thousands fo files.
Nobbie
 
Posts: 9689
Joined: 09. March 2008 13:04

Re: Speed up file serving with webserver

Postby matrixebiz » 28. September 2017 12:55

Hello, Ram and CPU are not taking a hit, it's the traffic load that is the issue so you think this is more of a hosting issue rather than a Apache serving files issue? The bandwidth speed of my provider server is 500 Mbps but when streaming traffic gets upwards of 150 Mbps, streaming is very bad. Looking for some advice as to what i need to overcome this issue. Thanks
matrixebiz
 
Posts: 12
Joined: 09. August 2017 19:47
XAMPP version: 7.1.7
Operating System: Windows Server 2016


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 53 guests