Help to make sh script adjust SQM automaticaly

I think the approach is intriguing. On a period basis:

  • Run a process to guarantee the link is fully-loaded
  • Make some measurement of max up and down transfer rates
  • Adjust the SQM params based on those measured speeds.

I don't know if these random thoughts might help/be feasible:

  • Using ifconfig values would seem to capture the actual number of bytes transferred in each direction. Thus it's not affected by other client traffic. You also avoid needing to install another package.

  • To get data rates, measure now with ifconfig, and measure again 30 seconds later to get two data samples. Subtract those values and divide the result by 30 seconds to get byte rate for that interval, and multiply by 8 to get bit rate.

  • I don't think it is necessary to shut off "normal client" traffic during these SQM-Adjustment measurement intervals. The process to load the up and down links will "fill in the gaps" of the client traffic to ensure the link is fully-loaded. This will be a brief time on a periodic basis, and will not significantly harm client traffic.

  • It is probably necessary to shut off SQM during the SQM-Adjustment measurement interval. (If the SQM parameters happen to be set too low, they would prevent the link from achieving its full capacity.)