- Data collection mechanism is a crucial factor for the performance of intrusion detection system (IDS). Simple random sampling and Stratified random sampling techniques of statistics are introduced to the procedure of data collection for IDS, and formulas used to calculate the sample size of packets based on these sampling techniques are presented. The implementation of packets sampling is provided, and efficiencies of these data collection mechanisms for IDS are compared in this paper. Experimental results show these two mechanisms both can improve the efficiency of data collection and strengthen the processing performance of IDS, while stratified random sampling technique performs better especially in the largescale high-speed network.