1. A method for maximizing throughput of a computer system in the presence of one or more power constraints, the method comprising: repeatedly or continuously optimizing task scheduling and assignment for each of a plurality of components of the computer system, wherein the components include a plurality of disk drives and a plurality of central processing units (CPUs) each operating at a corresponding operating frequency; and adjusting the corresponding operating frequencies of one or more CPUs of the plurality of CPUs to maximize computer system throughput under one or more power constraints; wherein said optimizing task scheduling and assignment, and said adjusting the corresponding operating frequencies of one or more CPUs, are performed by solving a mathematical optimization problem using a first methodology over a first time interval and a second methodology over a second time interval longer than the first time interval, and wherein the first methodology comprises a short term heuristic solver for adapting to computer system changes that occur over the first time interval, and the second methodology comprises a long term solver for adapting to computer system changes that occur over the second time interval, wherein the second methodology has greater accuracy and greater computational complexity than the first methodology.