You are trying to make a lot of simulataneous network connections to localhost. You get up to about 2000 HTTP requests per second, when your CPU usage goes up to 100% on all cores.
perf top reports the following:
31.01% [kernel] [k] inet_csk_bind_conflict
20.60% [kernel] [k] inet_csk_get_port
9.82% [kernel] [k] _raw_spin_lock
4.62% perf [.] 0x0000000000038ba1
3.90% [kernel] [k] _raw_read_unlock_bh