Membrane fouling, including foulants and factors, was investigated during hydraulic retention time (HRT) optimization of a membrane bioreactor (MBR) that treated wastewater from the production of antibiotics. The results showed that HRT played an important role in membrane fouling. Trans-membrane pressure (TMP), membrane flux, and resistance were stable at -6kPa, 76Lm-2h-1bar-1, and 4.5 × 1012m-1 when HRT was at 60, 48, and 36h, respectively. Using Fourier transform infrared spectroscopy, foulants were identified as carbohydrates and proteins, which correlated with effluent organic matter and effluent chemical oxygen demand (COD) compounds. Therefore, membrane fouling trends would benefit from low supernatant COD (378mgL-1) and a low membrane removal rate (26%) at a HRT of 36h. Serious membrane fouling at 72 and 24h was related to soluble microbial products and extracellular polymeric substances in mixed liquor, respectively. Based on the TMP decrease and flux recovery after physical and chemical cleaning, irremovable fouling aggravation was related to extracellular polymeric substances' increase and soluble microbial products' decrease. According to changes in the specific oxygen uptake rate (SOUR) and mixed liquor suspended solids (MLSSs) during HRT optimization in this study, antibiotic production wastewater largely inhibited MLSS growth, which only increased from 4.5 to 5.0gL-1 when HRT was decreased from 72 to 24h, but did not limit sludge activity. The results of a principal component analysis highlighted both proteins and carbohydrates in extracellular polymeric substances as the primary foulants. Membrane fouling associated with the first principal component was positively related to extracellular polymeric substances and negatively related to soluble microbial products. Principal component 2 was primarily related to proteins in the influent. Additional membrane fouling factors included biomass characteristics, operational conditions, and feed characteristics.