Author |
|
glowpopjigglyjam
Joined: 10 Mar 2008 Posts: 2
|
Posted: Mon 10 Mar '08 17:33 Post subject: Apache Limiting Download Speeds? |
|
|
Hello,
I’ve just got me a brand spanking new dedicated server, but unfortunately it seems I have a problem with Apache. I started off with Linux as my OS which had Apache preinstalled by my dedi providers and worked fine n' dandy. I am completely new to Linux so I gave up attempting to learn (as the longer it takes me the more I’m paying for websites I can’t set up the way I wish) and switched to Server 2003 which I have experience with.
Because I’m not a fan of IIS which my dedi providers set as the default web server, I’ve set up the latest Apache (2.2., MySQL and PHP and all is fine. However I’ve noticed a bottleneck when it comes to downloading files. I uploaded a 5mb video file to test the download speed and it seems I’m capping very steadily at around 215 KB/s. This is strange as I did the same test when the OS was Linux and it downloaded at my residential connection’s maximum speed of around 490 KB/s. It’s also that max speed if I where to download via FTP from the new windows server so I assume there’s an Apache config setting that’s capping the speed when I download via HTTP?
The file I’m referring to you can find at http://dedi.damonevans.net/ and by clicking the link. It would be lovely to know if anybody else is getting this 215KB/s cap.
Any advice on this would be greatly appreciated. |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Tue 11 Mar '08 23:22 Post subject: |
|
|
As far I know there is not any setting in Apache that is capping the speed.
Link http://dedi.damonevans.net/ is not given a file to download, so I cannot test it.
Steffen |
|
Back to top |
|
glowpopjigglyjam
Joined: 10 Mar 2008 Posts: 2
|
Posted: Wed 12 Mar '08 15:26 Post subject: |
|
|
Steffen wrote: | As far I know there is not any setting in Apache that is capping the speed.
Link http://dedi.damonevans.net/ is not given a file to download, so I cannot test it.
Steffen |
Yeah, I had a play around with pretty much every config parameter possible (SendBufferSize etc) to no avail.
However, I have the solution... use IIS (i'm almost ashamed to say it) Hence why you can't see the download link.
I assume the problem was a Server 2003 limitation, aka Server 2003's fault. But with IIS, users can now take full advantage of the available bandwidth, which is of more importance that the very few major differences between IIS and Apache (Apache being the winner).
Thanks anyway |
|
Back to top |
|
Thog
Joined: 12 Feb 2007 Posts: 75 Location: Montreal
|
Posted: Wed 12 Mar '08 15:56 Post subject: |
|
|
Sorry ... I Deleted the file |
|
Back to top |
|
Euclid
Joined: 19 Jun 2008 Posts: 2
|
Posted: Thu 16 Oct '08 5:30 Post subject: |
|
|
I actually see the same problem on Windows 2003 R2 with Apache 2.2.9. Regardless of what the SendBufferSize in the Apache .conf is set to the performance for high speed high latency connections does not improve.
I run numerous tests and my suspicion is that for some reason even if setsockopt(SO_SNDBUF) is called Winsock/AFD quietly ignores the value under some circumstances and uses the 8KB default buffer. Even if the SendBufferWindow registry value (AFD/Parameters) is set it did not make any difference with apache.
Regards,
Mat |
|
Back to top |
|
AMailer
Joined: 25 Sep 2006 Posts: 45 Location: Canada
|
Posted: Thu 16 Oct '08 17:35 Post subject: |
|
|
Yeah, I have also noticed Apache caps speeds at ~300KB/s
Best bet is to just use an FTP connection Since when I did use Apache for my fairly decent sized downloads, when a ton of people started downloaded, Apache started getting clogged. |
|
Back to top |
|
wm003
Joined: 24 Mar 2006 Posts: 88
|
Posted: Wed 10 Dec '08 15:24 Post subject: |
|
|
mod_bw is working perfect for me:
http://www.ivn.cl/apache/
Even the binary for 2.2.6 works for 2.2.8/2.2.9/2.2.10 |
|
Back to top |
|
DigitalDJ
Joined: 26 Mar 2006 Posts: 10
|
Posted: Sun 21 Dec '08 17:10 Post subject: |
|
|
Sorry for bumping an old thread BUT, I think I have a solution to this problem (and this one of the most relevant threads that showed up on Google when looking for a solution). So hopefully this will help others.
My problem:
From day 1 with my VPS (Win2003 SP2) I've been running Apache2.2 and I could never get it to transfer files above ~60KB/sec. Enabling GZIP bumped it up to 100KB/sec but the server was capable of 10Mbps. IIS put out at full speed and so did other webservers like Lighttpd. Apache Benchmark showed there was noting wrong with the server ...locally. My VPS is located in the US and I access it from Australia (about 200ms ping).
After months of searching I'd usually just give up and live with the crappy speed...until today, where I put in a bit more effort...and a few more threads started popping up on Google (but still with no solution)
The solution (for me anyway):
For me the problem was SendBufferSize in the Apache httpd.conf. Windows seems to complete ignore this value and Apache will use the default Winsock value for the buffer size (which I think is 4096). I'm no network expert but after researching a bit about it I found that this value can significantly reduce performance on High Latency/High Speed links when set too low.
So after more research I found that you could change the Default in Windows so that Apache would then use this new value (which I found here: http://forums.speedguide.net/showthread.php?t=185104).
You need to open up regedit and browse to:
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
Reboot and test your Apache speed. Mine was boosted from 60kb/sec to 300kb/sec (with Firefox, and full speed with a download manager)...certainly more like it for accessing my server from overseas.
Hopefully this helps some with this mystery.
Grant |
|
Back to top |
|
Intimidated
Joined: 28 May 2009 Posts: 1
|
Posted: Thu 28 May '09 20:35 Post subject: |
|
|
Hey,
Sorry for the thread necro but I was experiencing the same issue, and found this thread.
I eventually found the fix on IRC.
Quote: | [18:23] <burek021> try this
[18:23] <burek021> in your conf file
[18:23] <burek021> EnableSendfile Off
[18:23] <burek021> and restart
[18:23] <burek021> see if that helps |
.. and my server output immediately increased from 500k to 3.1 meg a sec.
This is with Apache/2.2.11 (Win32).
Hope this helps! |
|
Back to top |
|
JB007Rules
Joined: 17 Aug 2009 Posts: 1
|
Posted: Tue 18 Aug '09 0:02 Post subject: |
|
|
Intimidated wrote: | Hey,
Sorry for the thread necro but I was experiencing the same issue, and found this thread.
I eventually found the fix on IRC.
Quote: | [18:23] <burek021> try this
[18:23] <burek021> in your conf file
[18:23] <burek021> EnableSendfile Off
[18:23] <burek021> and restart
[18:23] <burek021> see if that helps |
.. and my server output immediately increased from 500k to 3.1 meg a sec.
This is with Apache/2.2.11 (Win32).
Hope this helps! |
Intimidated, THANK YOU THANK YOU THANK YOU for this!!!! My external downloads went from about 250kbps to 430kbps (4MB) and my internal downloads went from 320kbps to about 10.3mbps!!!
THANK YOU THANK YOU THANK YOU!!!! |
|
Back to top |
|
pagemeeting
Joined: 22 Aug 2009 Posts: 1
|
Posted: Sat 22 Aug '09 10:15 Post subject: download speed |
|
|
I have tried the above solutions with no luck.
I think EnableSendfile Off improves because the default value for Send BufferSize in httpd-mpm.conf is too low. If set to a decent value in the mpm_winnt_module section, it would probably work though it gave no good for me.
However, there is an enigma about this: when I download with a php script reading the file with a 1MB buffer, I get full speed (4Mb approx for me), while downloading from a basic href link, the speed is 800kb approx.
So, I think the registry settings mentionned above to improve speed have no influence on this, they may limit the connection speed, but that's not the only reason, apache probably reads files from disk with a ridiculous buffer, or say suited for tiny files like most of the htmls, and is not sized for bigger files you usuallly download and is therefore is a lot slower than my php script with its 1MB buffer. If anyone knows how to improve files reading on disk for apache, welcome... |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Sat 22 Aug '09 14:26 Post subject: |
|
|
The biggest limitation with EnableSendfile On is that it only allows two simultaneous responses to be sent at the same time if you are running a non-server edition of Windows. Sendfile on Windows uses the Windows TransmitFile function internally. The TransmitFile docs say:
Quote: | Workstation and client versions of Windows optimize the TransmitFile function for minimum memory and resource utilization by limiting the number of concurrent TransmitFile operations allowed on the system to a maximum of two. On Windows Vista, Windows XP, Windows 2000 Professional, and Windows NT Workstation 3.51 and later only two outstanding TransmitFile requests are handled simultaneously; the third request will wait until one of the previous requests is completed. |
This restriction doesn't apply to server versions of Windows.
-tom- |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sat 22 Aug '09 17:42 Post subject: |
|
|
So I shoud use EnableSendfile On on W2k3 or doesn't it make any difference? |
|
Back to top |
|
Elmer
Joined: 28 Oct 2011 Posts: 1
|
Posted: Tue 01 Nov '11 11:02 Post subject: |
|
|
James Blond wrote: | So I shoud use EnableSendfile On on W2k3 or doesn't it make any difference? |
it doesn't change the situation, so it makes no sense, i believe. |
|
Back to top |
|
Jcink
Joined: 06 Mar 2006 Posts: 23
|
Posted: Mon 05 Dec '11 9:12 Post subject: |
|
|
I'm running Windows 7 Ultimate SP1 and have experienced this problem for a long time now.
Download speed was capped to 215-250KB/sec. FTP and everything else was and still is fine.
Thank you for the EnableSendfile Off fix. It made a huge difference, although it's not perfect. I'm getting 1.1MB/sec down. I should be getting 2.3MB/sec down since this over wireless, and I can achieve this speed with no problem from my other boxes.
There is obviously something else that's still limiting it buried somewhere.... |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 05 Dec '11 14:31 Post subject: |
|
|
As Tom wrote the OS is limiting this. You are using a client OS for apache. As far as I know there are some tweaking tools for Win7 to increase the network stuff / TransmitFile operations. I haven't done that myself since I use Windows 2008 R2 server now and before Windows 2003 server. |
|
Back to top |
|
albade
Joined: 15 Nov 2013 Posts: 1
|
Posted: Sat 16 Nov '13 18:16 Post subject: |
|
|
i also use windows 7 ultimate, but never find that trouble.. did you think spec of computer be one of the factor?
house to home designs |
|
Back to top |
|