5. In $\triangle A B C$, $\overrightarrow{A B} \cdot \overrightarrow{B C}=3 \overrightarrow{C A} \cdot \overrightarrow{A B}$. Then the maximum value of $\frac{|\overrightarrow{A C}|+|\overrightarrow{A B}|}{|\overrightarrow{B C}|}$ is ().
(A) $\frac{\sqrt{5}}{2}$
(B) $\sqrt{3}$
(C) 2
(D) $\sqrt{5}$
5. B.

From the given conditions,
$$
\begin{array}{l}
a^{2}+c^{2}-b^{2}=3\left(b^{2}+c^{2}-a^{2}\right) \\
\Rightarrow 2 a^{2}=2 b^{2}+c^{2} . \\
\text { Then } (b+c)^{2}=\left(\frac{\sqrt{2}}{2} \cdot \sqrt{2} b+1 \cdot c\right)^{2} \\
\leqslant\left(\left(\frac{\sqrt{2}}{2}\right)^{2}+1^{2}\right)\left(2 b^{2}+c^{2}\right)=3 a^{2} . \\
\text { Therefore, } \frac{b+c}{a} \leqslant \sqrt{3} .
\end{array}
$$

Equality holds if and only if $\frac{\sqrt{2} b}{\frac{\sqrt{2}}{2}}+\frac{c}{1}, 2 a^{2}=2 b^{2}+c^{2}$, i.e., $a: b: c=\sqrt{3}: 1: 2$. 
Thus, the maximum value sought is $\sqrt{3}$.