7. There is a conical container with its vertex at the bottom and its base horizontal, and its axial section is an equilateral triangle with a side length of 6. The container is filled with water. Now, a square prism with a base side length of $a(a<6)$ is vertically immersed in the container. To make the water overflow from the container as much as possible, the value of $a$ should be $\qquad$ .
7. $2 \sqrt{2}$.

As shown in Figure 2, taking the cross-section through the diagonal vertices of the square base of the quadrilateral prism, we obtain an equilateral triangle and its inscribed rectangle, with the base length being $2 a$ and the height being $h$. Therefore,
$$
\frac{3 \sqrt{3}-h}{3 \sqrt{3}}=\frac{\sqrt{2} a}{6} \Rightarrow h=3 \sqrt{3}-\frac{\sqrt{6} a}{2},
$$

Thus, the volume of the water that overflows from the container is
$$
\begin{array}{c}
V=a^{2}\left(3 \sqrt{3}-\frac{\sqrt{6} a}{2}\right)=\frac{\sqrt{6}}{2} a^{2}(3 \sqrt{2}-a)=2 \sqrt{6} \cdot \frac{1}{2} a \cdot \frac{1}{2} a(3 \sqrt{2}-a) \\
\leqslant 2 \sqrt{6}\left(\frac{\frac{1}{2} a+\frac{1}{2} a+3 \sqrt{2}-a}{3}\right)=2 \sqrt{6}(\sqrt{2})^{3}=8 \sqrt{3}
\end{array}
$$

Equality holds if and only if $a=2 \sqrt{2}$.