4. Let $x, y, z$ be real numbers, not all zero, find the maximum value of $\frac{x y+2 y z}{x^{2}+y^{2}+z^{2}}$.
4. Using the method of undetermined coefficients, we know that $x y+2 y z \leqslant \frac{\sqrt{5}}{2}\left(x^{2}+y^{2}+z^{2}\right)$, so when $10 x=$ $2 \sqrt{5} y=5 z$, $\frac{x y+2 y z}{x^{2}+y^{2}+z^{2}}$ achieves its maximum value $\frac{\sqrt{5}}{2}$.