The invention relates to a method for setting an optimal substitution flow in the ultrafiltration of blood, in which method the mean molecular cleaning performance is measured on line, after which the flow rate of the substitution solution can be specifically adapted to achieve a defined dialysis result.