Operation of membrane systems for water treatment can be seriously hampered by biofouling. A better characterization of biofilms in membrane systems and their impact on membrane performance may help to develop effective biofouling control strategies. The objective of this study was to determine the occurrence, extent and timescale of biofilm compaction and relaxation (decompaction), caused by permeate flux variations. The impact of permeate flux changes on biofilm thickness, structure and stiffness was investigated in situ and non-destructively with optical coherence tomography using membrane fouling monitors operated at a constant crossflow velocity of 0.1 m s−1 with permeate production. The permeate flux was varied sequentially from 20 to 60 and back to 20 L m−2 h−1. The study showed that the average biofilm thickness on the membrane decreased after elevating the permeate flux from 20 to 60 L m−2 h−1 while the biofilm thickness increased again after restoring the original flux of 20 L m−2 h−1, indicating the occurrence of biofilm compaction and relaxation. Within a few seconds after the flux change, the biofilm thickness was changed and stabilized, biofilm compaction occurred faster than the relaxation after restoring the original permeate flux. The initial biofilm parameters were not fully reinstated: the biofilm thickness was reduced by 21%, biofilm stiffness had increased and the hydraulic biofilm resistance was elevated by 16%. Biofilm thickness was related to the hydraulic biofilm resistance. Membrane performance losses are related to the biofilm thickness, density and morphology, which are influenced by (variations in) hydraulic conditions. A (temporarily) permeate flux increase caused biofilm compaction, together with membrane performance losses. The impact of biofilms on membrane performance can be influenced (increased and reduced) by operational parameters. The article shows that a (temporary) pressure increase leads to more compact biofilms with a higher hydraulic resistance. © 2015 Balaban Desalination Publications. All rights reserved.