The invention relates to disinfection or sterilization of water used further in industrial food processing systems. A disinfecting fluid used in the above systems is produced by electrolysis in a diaphragm electrochemical cell from an aqueous solution containing soduim chloride. pH of the disinfecting fluid is controlled by introducing portion of electrochemically produced catholyte into the anode chamber. The necessary amount of catholyte is determined based on the estimation of the final pH which is carried out based on the measurements of the initial aqueous solution conductivity, flow rate within the cell and/or applied voltage. Table comprising the correlations between pH and the above parameters is programmed into the system and used for controlling the catholyte stream and thus for pH control.