A mathematical model of a cascade of two continuously stirred anaerobic bioreactors is presented in this paper and the extremum seeking control is applied on it. The dilution rate of the first bioreactor is chosen as control action and the joint biogas flow rate both bioreactors is the measured output to be maximized. The concentration of inlet organics is accepted as the disturbance. The correction of the working volume of the second bioreactor is studied as the inner loop of the cascade control system. The outer control loop is represented by the extremum seeking controller, which finds the optimum control action and reacts to the disturbance. Computer simulation studies show the feasibility of this scheme.