4. Given that $a, b, c$ are not all zero. Then the maximum value of $\frac{ab+2bc}{a^2+b^2+c^2}$ is $\qquad$
4. $\frac{\sqrt{5}}{2}$.

Let $x, y \in \mathbf{R}^{+}$, then $x^{2} a^{2}+b^{2} \geqslant 2 x a b, y^{2} b^{2}+c^{2} \geqslant 2 y b c$,
i.e., $\square$
$$
\begin{array}{l}
\frac{x}{2} a^{2}+\frac{b^{2}}{2 x} \geqslant a b, \\
y b^{2}+\frac{1}{y} c^{2} \geqslant 2 b c .
\end{array}
$$
(1) + (2) gives
$$
\begin{array}{l}
\frac{x}{2} a^{2}+\left(\frac{1}{2 x}+y\right) b^{2}+\frac{1}{y} c^{2} \geqslant a b+2 b c . \\
\text { Let } \frac{x}{2}=\frac{1}{2 x}+y=\frac{1}{y} .
\end{array}
$$

Solving it, we get $x=\sqrt{5}, y=\frac{2}{5} \sqrt{5}$.
Thus, $\frac{\sqrt{5}}{2}\left(a^{2}+b^{2}+c^{2}\right) \geqslant a b+2 b c$,

i.e., $\frac{a b+2 b c}{a^{2}+b^{2}+c^{2}} \leqslant \frac{\sqrt{5}}{2}$
(when $\sqrt{5} a=b=\frac{\sqrt{5}}{2} c$ the equality holds).