We introduce the notion of spectral flow along a periodic semi-Riemannian geodesic, as a suitable substitute of the Morse index in the Riemannian case. We study the growth of the spectral flow along a closed geodesic under iteration, determining its asymptotic behavior.