Abstract-Nowadays, due to current high-speed links, applying traffic sampling has become nearly mandatory in order to make Internet traffic monitoring feasible. However, its impact on state-of-the-art algorithms is unclear and has become a topic of foremost importance. Specifically, focusing on the impact of sampling on the detection of scanning cyberattacks, former studies concluded that Flow Sampling was the best technique. In this paper we first evaluate how two well-known algorithms for scan detection perform under sampling and confirm its dramatic impact. Unlike previously reported, we show that Packet Sampling performs better than Flow Sampling under certain scenarios. This is important because routers only support packet-based sampling. The second part of this paper, taking into account the good results for scan detection reported by a sampling technique called Selective Sampling (SES), proposes a new sampling technique, Online Selective Sampling (OSES), that samples the same traffic that SES but uses less resources. Instead of requiring aggregation of packets into flows before sampling, OSES works online on a packet-per-packet basis and, therefore, it does not need to capture all the traffic. We show that OSES is significantly faster and consumes up to ≈40% less memory than SES while keeping the same good performance.