This Python script is an asynchronous HTTP client designed for load testing web servers by sending multiple parallel requests.
- Uses asynchronous requests via the
aiohttp
library - Supports up to 1000 concurrent tasks (configurable)
- Automatically restarts on errors
- Logs errors to
log.txt
- Replace
url = 'https://example.com'
with your target server URL - Adjust the number of concurrent tasks by modifying
range(1000)
in themain()
function
- Infinite request loop
- Error handling and logging with timestamps
- 3-second delay after errors before restarting
- Python 3.7+
- Dependencies:
aiohttp
pip install aiohttp
Simply run the script:
python main.py
Use this code only for testing servers you are authorized to load-test. Unauthorized load testing may be illegal.