Pastebin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python

import time
import sys
import multiprocessing
from multiprocessing.pool import ThreadPool

import requests


CPUS = multiprocessing.cpu_count() * 2
thread_pool = ThreadPool(processes=CPUS)

url = 'http://localhost:8080/p/wiki/Home'
if len(sys.argv) > 1:
    url = sys.argv[1]

while True:
    thread_pool.apply_async(requests.get, args=(url,))
    time.sleep(1)