I am using windows.
You should have stated this as the first thing in your question.
On Windows, Perl's fork
is actually implemented using Windows threads. Many of the features of real *nix forks do not apply. While Parallel::ForkManager
can still be useful for a variety of tasks on Windows, do not expect the kind of performance you need for this particular task.
You may also be disappointed with ab
on Windows (although, that strongly depends on your hardware and how ab
was compiled etc). It would still perform better than Perl + FM + Mech, but I do not expect it to be able to reach what it could with BSD or Linux on the same hardware.
For this specific purpose, you may be better off using a non-Windows machine, unless you want to venture into Windows-specific network programming.
Also, curl builds cleanly on Windows 8.1 using Visual Studio 2013 and 2015 Community Edition tools, and, if that does not work, binaries are available.
But, the path of least resistance is not to do this from Windows (the version of ab
on the Windows 8.1 partition may be older than the Arch one in this instance, but I am not motivated to fix that).
Here is a simple comparison. I am posting the Windows results first, then I am going to reboot into ArchLinux and post those:
C:\opt\httpd\bin> ab -n 100 -c 10 http://www....com/
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.....com (be patient).....done
Server Software: Apache
Server Hostname: www.....com
Server Port: 80
Document Path: /
Document Length: 4502 bytes
Concurrency Level: 10
Time taken for tests: 6.391 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 475900 bytes
HTML transferred: 450200 bytes
Requests per second: 15.65 [#/sec] (mean)
Time per request: 639.136 [ms] (mean)
Time per request: 63.914 [ms] (mean, across all concurrent requests
Transfer rate: 72.71 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 59 63 2.7 62 76
Processing: 65 542 99.0 567 586
Waiting: 63 321 162.4 316 586
Total: 125 605 98.5 630 653
Percentage of the requests served within a certain time (ms)
50% 630
66% 633
75% 635
80% 638
90% 644
95% 647
98% 649
99% 653
100% 653 (longest request)
compared to the following in XFCE4 Terminal on ArchLinux (same hardware, same network connection):
$ ab -n 100 -c 10 http://www....com/
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.....com (be patient).....done
Server Software: Apache
Server Hostname: www.....com
Server Port: 80
Document Path: /
Document Length: 4502 bytes
Concurrency Level: 10
Time taken for tests: 1.799 seconds
Complete requests: 100
Failed requests: 0
Total transferred: 475900 bytes
HTML transferred: 450200 bytes
Requests per second: 55.60 [#/sec] (mean)
Time per request: 179.867 [ms] (mean)
Time per request: 17.987 [ms] (mean, across all concurrent requests)
Transfer rate: 258.38 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 59 81 16.3 77 113
Processing: 62 91 19.9 89 151
Waiting: 60 82 16.5 79 139
Total: 126 172 15.1 174 226
Percentage of the requests served within a certain time (ms)
50% 174
66% 175
75% 176
80% 180
90% 190
95% 192
98% 209
99% 226
100% 226 (longest request)