4. The function
$$
f(x)=\sqrt{x-5}+\sqrt{24-3 x}
$$

has a maximum value of ( ).
(A) $\sqrt{3}$
(B) 3
(C) $2 \sqrt{3}$
(D) $3 \sqrt{3}$
4. C.
The domain of $f(x)$ is $5 \leqslant x \leqslant 8$.
From $f^{\prime}(x)=\frac{1}{2 \sqrt{x-5}}+\frac{-3}{2 \sqrt{24-3 x}}=0$ $\Rightarrow x=\frac{23}{4}$.
Since $f(5)=3, f\left(\frac{23}{4}\right)=2 \sqrt{3}, f(8)=\sqrt{3}$,
thus, $f(x)_{\max }=f\left(\frac{23}{4}\right)=2 \sqrt{3}$.