Security researchers often experiment with different methods to test system resilience:
Writing a DDoS script for work - suggestions? : r/cybersecurity python ddos script
Closing "hanging" connections quickly to free up resources. python ddos script