  We prove an upper bound for the number of Ruelle resonances for Koopman
operators associated to real-analytic Anosov diffeomorphisms: in dimension $d$,
the number of resonances larger than $r$ is a $\mathcal{O}(|\log r|^d)$ when
$r$ goes to $0$. For each connected component of the space of real-analytic
Anosov diffeomorphisms on a real-analytic manifold, we prove a dichotomy:
either the exponent $d$ in our bound is never optimal, or it is optimal on a
dense subset. Using examples constructed by Bandtlow, Just and Slipantschuk, we
see that we are always in the latter situation for connected components of the
space of real-analytic Anosov diffeomorphisms on the $2$-dimensional torus.
