Resource Solver
Linear programming for fun and profit

Linear programming for fun and profit

5/7/2025

What this post added

This post introduces Modal's 'resource solver' system, which uses linear programming (LP) to manage cloud compute resources. It details how the system addresses the volatility of the GPU market by optimizing instance selection and scaling to meet customer demand at predictable prices. The post explains the evolution from a simple demand-satisfaction script to a complex LP problem involving multiple instance types, resource constraints (CPU, RAM, GPU), varying user demand, and fluctuating cloud provider prices. It highlights the use of Google's GLOP solver for production reliability and discusses the implementation details, including heuristics for pruning instance types to ensure fast solve times and a feedback loop for observed scaling limits. The solver's dual mandate of speed and cost-optimality is emphasized, positioning it as a core component for Modal's serverless infrastructure.

Read the original post ↗