4. Given that $x$ and $y$ are real numbers, $x^{2}-x y+y^{2}=1$. Then the maximum value of $x+2 y$ is $\qquad$ .
4. $\frac{2 \sqrt{21}}{3}$.

Notice that, $3(x+2 y)^{2}-28\left(x^{2}-x y+y^{2}\right)=-(5 x-4 y)^{2} \leqslant 0$ $\Rightarrow x+2 y \leqslant \frac{2 \sqrt{21}}{3}$ (the coefficients 3 and 28 are obtained by the method of undetermined coefficients, which involves treating $x$ as the main variable, and ensuring that the discriminant of $(x+2 y)^{2}-m\left(x^{2}-x y+y^{2}\right)$ is a perfect square).