A method and apparatus for producing a biocide from a hypochlorite oxidant and an ammonium salt are provided. The method includes monitoring a control parameter to optimize the ratio between the hypochlorite oxidant and the ammonium salt. The control parameter may be oxidation-reduction potential, conductivity, induction or oxygen saturation.一種從次氯酸鹽氧化劑和銨鹽生產殺生物劑的方法和設備。該方法包括:監測一控制參數以優化該次氯酸鹽氧化劑和銨鹽之間的比率。該控制參數可以是氧化還原電位、導電率、電磁感應或氧飽和度。