4. If real numbers $x, y, z$ satisfy
$$
x^{2}+y^{2}+z^{2}-(x y+y z+z x)=8 \text {, }
$$

let $A$ denote the maximum value of $|x-y|, |y-z|, |z-x|$, then the maximum value of $A$ is $\qquad$.
4. $\frac{4 \sqrt{6}}{3}$.

From the problem, we know
$$
(x-y)^{2}+(y-z)^{2}+(z-x)^{2}=16 \text {. }
$$

Let's assume $A=|x-y|$. Then
$$
\begin{array}{l}
A^{2}=(x-y)^{2}=[(y-z)+(z-x)]^{2} \\
\leqslant 2\left[(y-z)^{2}+(z-x)^{2}\right] \\
=2\left[16-(x-y)^{2}\right] \\
=2\left(16-A^{2}\right) .
\end{array}
$$

Solving this, we get $A \leqslant \frac{4 \sqrt{6}}{3}$.
Therefore, when $|x-y|=\frac{4 \sqrt{6}}{3},|y-z|=|z-x|=$ $\frac{2 \sqrt{6}}{3}$, $A$ achieves its maximum value of $\frac{4 \sqrt{6}}{3}$.