*2. Let $M, N$ be two points on the line segment $AB$, $\frac{AM}{MB}=\frac{1}{4}, \frac{AN}{NB}=\frac{3}{2}$. Construct any right triangle $\triangle ABC$ with $AB$ as the hypotenuse. Then construct $MD \perp BC$ at $D$, $ME \perp AC$ at $E$, $NF \perp BC$ at $F$, and $NG \perp AC$ at $G$. The maximum possible value of the ratio $y=\frac{MD+ME+NF+NG}{AB+BC+AC}$ is
2. $\frac{10-4 \sqrt{3}}{5}$.

Let $\angle A=\alpha\left(0<\alpha<\frac{\pi}{2}\right) . AB=5$, then $AC=5 \cos \alpha$, $BC=5 \sin \alpha, MD=4 \cos \alpha, ME=\sin \alpha, NF=2 \cos \alpha, NG$ $=3 \sin \alpha$, thus
$$
\begin{aligned}
y & =\frac{4 \cos \alpha+\sin \alpha+2 \cos \alpha+3 \sin \alpha}{5 \cos \alpha+5 \sin \alpha+5} \\
& =\frac{6 \cos \alpha+4 \sin \alpha}{5 \cos \alpha+5 \sin \alpha+5} \\
& (5 y-4) \sin \alpha+(5 y-6) \cos \alpha=-5 y, \\
& \sqrt{(5 y-4)^{2}+(5 y-6)^{2}} \sin (\alpha+\theta)=-5 y .
\end{aligned}
$$

Since $|\sin (\alpha+\theta)| \leqslant 1$,
we have, $(5 y-4)^{2}+(5 y-6)^{2} \geqslant(-5 y)^{2}$,
solving this gives $y \geqslant \frac{10+4 \sqrt{3}}{5}$ (which does not meet the problem's requirements and is discarded) or $y \leqslant$ $\frac{10-4 \sqrt{3}}{5},$ the maximum value of $y$ is $\frac{10-4 \sqrt{3}}{5}$.