-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Too little bandwidth #2
Comments
I commented out your fixes for WIN32, which enforced a minimum 200ms delay between packets. It's working much better now. If I understand the fix and based on my bandwidth requirements above, the fix results in a 50 MB packet size for my large (400 MB) file (250000000 / 5 = 50 MBps). However, it looks like the problem is the bucket size is only 8000 bytes. So the Windows fix ends up limiting the bandwidth to 8000 bytes per 200ms. Per the APR guide (https://apr.apache.org/docs/apr-util/trunk/group___a_p_r___util___bucket___brigades.html#ga82bf404af30875135c65e2c13ad035e5), the default bucket size is 8000 bytes. I'm not seeing a quick way to make the buckets bigger for file reads so it seems like the better approach is to calculate how many buckets it takes to get to the minimum timer resolution, say 10 ms, based on desired bandwidth, then pass on that number of buckets before sleeping. I haven't had a chance to work on that further today though. |
I've worked around this problem by re-writing your Windows-only section such that if the calculated sleep time is less than 10ms, another calculation determines how many buckets could be passed in 10ms and sets up a counter. The counter is decremented for each bucket passed until it reaches zero, then sleeping happens (for 10ms). If the available bandwidth changes before the counter reaches zero, the counter is updated to reflect the new rate minus the number of packets already sent. If that's less than zero (i.e. more packets already sent than the newly available bandwidth), the counter is zeroed so sleep happens after the current bucket is sent. This has two side-effects in Windows:
I didn't do a pull as I understand you have a new version "coming soon" but I'd be happy to share my suggested code updates. |
Hi, The new version has been frozen for a while (loooooooong while) due to work (or lack there of), but it is coming. |
I'll see what I can do.. My previous experience/knowledge of git/github has been limited to posting issues and/or commenting on them. In summary, I've really made three changes at this point:
Anyway, I'm taking the crash course on git right now so hopefully I can upload my code soon. |
My github expertise is ... basic, so dont worry ! If you want, just post a diff here :) |
Ok.. I created a PR. I decided not to make the Windows configurable, leaving it at 10ms. |
I'm setting up a new server with mod_bw-0.92-2.4.x-x64-vs16 from ApacheHaus on Apache 2.4.51, on Windows Server 2019. I just discovered that with mod_bw enabled, files download very very slowly, far slower than the specified bandwidth. The server has a 10 gig interface. The bandwidth specified is very large (250 MB/sec), as I'm just trying to prevent multiple simultaneous downloads from overwhelming the interface.
Any ideas on the cause? I've tried various values for the packet size and lowered the bandwidth to 250 KB/sec (just took 3 zeros off the end). As the server is not in production yet, my test download was the only active session.
These are my settings:
BandWidthModule On
ForceBandWidthModule On
#Limit overall server bandwidth to 3 Gpbs (which is actually 375 megabytes/sec)
BandWidth all 375000000
MinBandWidth all 0
BandWidthPacket 32768
#Limit large file (more than 10mb) transfers to 2Gbps
LargeFileLimit * 10240 250000000
I saw a post mentioning issues with timing resolution in Windows. Could that be the cause?
The text was updated successfully, but these errors were encountered: