5. Given 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}$
$$
a c \cos B=3 b c \cos A \Rightarrow 2 a^{2}=2 b^{2}+c^{2} \Rightarrow 2\left(\frac{b}{a}\right)^{2}+\left(\frac{c}{a}\right)^{2}=2 \text {, }
$$

By the Cauchy-Schwarz inequality, $\left(\frac{b+c}{a}\right)^{2} \leqslant\left(\frac{1}{2}+1\right)\left[2\left(\frac{b}{a}\right)^{2}+\left(\frac{c}{a}\right)^{2}\right]=3 \Rightarrow \frac{b+c}{a} \leqslant \sqrt{3}$, equality holds when $\frac{2 b}{a}=\frac{c}{a}=\frac{2 \sqrt{3}}{3}$. Therefore, the answer is $B$.