It is well known that collisionless shocks are major sites of particle acceleration in the universe, but the details of the acceleration process are still not well understood. The particle acceleration rate, which can shed light on the acceleration process, is rarely measured in astrophysical environments. Here, we use observations of gamma-ray burst (GRB) afterglows, which are weakly magnetized relativistic collisionless shocks in ion-electron plasma, to constrain the rate of particle acceleration in such shocks. We find, based on X-ray and GeV afterglows, an acceleration rate that is most likely very fast, approaching the Bohm limit, when the shock Lorentz factor is in the range of Γ ∼ 10-100. In that case X-ray observations may be consistent with no amplification of the magnetic field in the shock upstream region. We examine the X-ray afterglow of GRB060729, which is observed for 642days showing a sharp decay in the flux starting about 400days after the burst, when the shock Lorentz factor is 5. We find that inability to accelerate X-ray-emitting electrons at late time provides a natural explanation for the sharp decay, and that also in that case acceleration must be rather fast, and cannot be more than a 100times slower than the Bohm limit. We conclude that particle acceleration is most likely fast in GRBafterglows, at least as long as the blast wave is ultrarelativistic.