Skip to content

Conversation

@sosherof
Copy link

This branch includes the following:

  • Since Windows can only sleep for a minimum of 1ms, module now calculates how many packets can be sent in 10ms, based on currently available bandwidth, and bypasses the sleep function however many times before finally sleeping for 10ms. If available bandwidth changes during that window, the remaining bypass counter is adjusted.
  • For all platforms, the client's bandwidth is calculated based on the bytes transmitted over a 15ms interval. If the client's bandwidth is already less than the available bandwidth, no sleep occurs since there's no reason to further reduce transmission speed when the client is already the limiting factor.
  • Certain variables where updated to unsigned long long, to force 64-bit math even in 32-bit systems. This is to accommodate larger files and bigger configured bandwidth specifications. In places where the bytes sent was added to the atomic stats info, the 32-bit function was replaced with the 64-bit function.
  • Per APR documentation, a filter may get invoked once or more than once with one or more buckets in each brigade. This necessitates tracking the Windows sleep bypass counters and the client bandwidth calculations across multiple invocations. Variables for these purposes where moved to the ctx_struct, which is preserved between invocations for the same request.
  • In Apache 2.4, remote_addr was renamed client_addr.

…acking to bypass sleeping if client's bandwidth is already less than available.
…acking to bypass sleeping if client's bandwidth is already less than available.
… calcuations to avoid sleeping if client bandwidth is less than available.
…ff than there actually are. Reverted some of these.Removed math.h include that wasn't needed.
@sosherof
Copy link
Author

Sorry there's so many commits. I was struggling to get VS to proper commit. Not only did my first attempt include extra files but also VS seems to have changed some of the formatting/spacing, which makes it appear there are more changes than there really are. I tried to revert some of these but it's a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant