9

A C++ program that spawns as many threads as it can to open TLS 1.2 connections to a given server and send random data.

Needed this to test scalability of one of our services.

Comments
  • 1
    Something like that is fun to write yourself. Maybe use library if you're not familiar with sockets yet
  • 0
    Also, why c++? The network will limit speed anyway. I would use aiohttp python lib
  • 1
    can be written in majority languages' core network stack
    Do limit the threads to double digits tho, I remember I did something similar with ICMP ping ages ago during my internship n for some N+ threads, Ubuntu did a Kernel Panic and the network driver/device crashed, only way to fix was a reboot (service restart didn't help either)

    not a heavy-Linux guy so maybe theres better ways to circumvent it (if it hasn't been fixed already), but if you do spawn unlimited threads, try to keep 50/double digit active ones, (thradpool works)
  • 1
    Oh fuck - you already made this - my bad
  • 0
    @azuredivay This runs easily with 2500 threads on a VM with 4 cores. Anything north of 2500 and madness will ensue.
  • 1
    @mansur85 Putting this on github = Being fired. Hence, thanks bu no thanks
  • 0
    @retoor I don't do Python because I care about the rain forests. How much Carbon dioxide will running Phyton code generate?

    https://towardsdatascience.com/how-...
Add Comment