The present invention relates to a method and apparatus for controlling loading of waste water into a biological treatment system (20) comprising an attached growth bioreactor, wherein the method comprises computing a thickness of a microbial biofilm (48) on a surface (32) of said attached growth bioreactor by using a laser triangulation method and controlling loading of waste water into said biological treatment system (20) based on said thickness of said microbial biofilm (48).