Every driveshaft has a speed where it starts to whip and vibrate. This finds it from your tube size and length, and translates it into the top speed your gearing allows.
This is the standard formula for a steel tube, with diameters and length in inches. Aluminum's stiffness-to-weight ratio is close to steel's, so the result is similar for aluminum tubes of the same size. Carbon fiber shafts differ and should use the manufacturer's rating.
Driveshaft speed equals wheel speed times the axle ratio, so numerically higher gears and smaller tires spin the shaft faster at a given road speed. Staying well below critical speed, commonly at 65 to 75% of it, leaves room for balance and u-joint condition.