Admin::JobsController#cancel_all loads all running/pending CI::Builds in memory
Ci::Build.running_or_pending.each(&:cancel)
This should use batches to load them into memory. Futhermore, this could timeout the request, so need to moved to a background job.