Many developments in science and engineering depend on tackling complex optimizations on large scales. The challenge motivates an intense search for specific computing hardware that takes advantage of quantum features, nonlinear dynamics, or photonics. A paradigmatic optimization problem is to find low-energy states in classical spin systems with fully random interactions. To date, no alternative computing platform can address such spin-glass problems on a large scale. Here, we propose and realize an optical scalable spin-glass simulator based on spatial light modulation and multiple light scattering. By tailoring optical transmission through a disordered medium, we optically accelerate the computation of the ground state of large spin networks with all-to-all random couplings. Scaling of the operation time with the problem size demonstrates an optical advantage over conventional computing. Our results highlight optical vector-matrix multiplication as a tool for spin-glass problems and provide a general route toward large-scale computing that exploits speed, parallelism, and coherence of light.