4. Find the largest real constant $\lambda$, such that for any positive integer $n$ and positive real numbers $x_{1}, x_{2}, \cdots, x_{n}$ satisfying $\sum_{i=1}^{n} \frac{1}{x_{i}}=n$, it always holds that $\prod_{i=1}^{n} x_{i}-1 \geqslant \lambda\left(\sum_{i=1}^{n} x_{i}-n\right)$.
Let
$$
x_{1}=\frac{1}{n-\alpha}, x_{2}=x_{3}=\cdots=x_{n}=\frac{n-1}{\alpha} \text {, }
$$

where $\alpha$ is a positive real number less than $n$.
Then, as $\alpha \rightarrow n$, $\lambda \leqslant\left(\frac{n-1}{n}\right)^{n-1}$. Hence, $\lambda \leqslant \frac{1}{\mathrm{e}}$.
We then prove by induction: $\prod_{i=1}^{n} x_{i}-1 \geqslant \frac{1}{\mathrm{e}}\left(\sum_{i=1}^{n} x_{i}-n\right)$.