Can you really make 1000+ connections at once without async?

some skid is writing a program related to connecting to alot of servers at the same time (concurrency). and he demonstrated the fact that there are over 1000-3000 connections per second. I've asked him for evidence including but not limited to showing me the behavior that the program makes on wireshark, cpu usage, etc.

and the calculations are print statements, which can easily be false

also he is using a synchronous library that takes in a std synchronous tcp socket only, not async, and communicates with the receiver.

my question to this is that is any of this possibly true? he claimed to use some "thread pool" but that doesn't really help his case.

my theory is that a bunch of threads are being spawned and they are overwriting each other, possibly throwing off his calculations.

I believe it is possible to spawn that many threads, yes. It would probably consume a fair amount of memory, though.

1 Like

but that many concurrent connections? he nearly got to 3k completely separate tcp connections at the same time so he claimed, and this software is obviously malicious.

you're saying that many tcp requests can occur by using a thread pool?

I don't see where is the problem. Do you worry about too many opened file descriptors? If so, then it doesn't matter if this person's application is sync or not, does it?

1 Like

That is likely the case

Why do you assume that? If properly implemented, why would anything overwrite anything else?

Also, handling requests synchronously with a thread pool is a well-known technique, that's how pretty much all of PHP-based servers work.
Note that if the requests are processed quickly enough, you don't even need all that many threads at the same time.

4 Likes

mass connecting to servers is malware in his case, the ips came from cidrs

each connection/response takes 800 ms on average, also if he were to do async anyway i assume there would be alot more connections made correct

  • concurrent connections can be implemented without async by using nonblocking sockets and polling or busy-looping or by using read timeouts
  • threads are cheap to spawn, especially if you limit their stack space. thousands is easily possible on modern computers
  • a connection lifetime being 800ms does not mean a thread will have to spend 800ms in blocking syscalls. One could let the OS fill up socket buffers for some time before trying to read from them

It may not be the most efficient way to approach things, but it's entirely possible.

7 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.