The rate at which an ecosystem accumulates biomass, including the energy it uses for the process of respiration.