Subject: | Net::Server::HTTP not reliable on Windows |
Date: | Mon, 7 Sep 2020 08:40:17 +0200 |
To: | bug-Net-Server [...] rt.cpan.org |
From: | Gilles LAMIRAL <gilles [...] lamiral.info> |
Hello,
I'm currently using the latest Perl module Net::Server::HTTP release 2.009
available at https://metacpan.org/pod/Net::Server::HTTP
Thanks for developing it!
It works well on Linux but I also need it to work on Windows.
For now, it is my second attempt in two years,
it doesn't offer the same stability on the Windows platform.
I'm using latest Strawberry Perl 5.30.2.1
taken at http://strawberryperl.com/
Even the oneliner is not reliable:
For example, I do this on a windows host:
perl -e "use base qw(Net::Server::HTTP); main->run()"
On a linux host I run "ab" which is a basic tool to run http connexions
and measure them:
ab -v4 -s10 -n6 http://192.168.103.24/
-v4 : verbosity level - 4 and above prints information on headers
-s10 : timeout 10 secondes
-n6 : 6 requests to perform for the benchmarking session.
...
The first time, I get those first good results:
################################################
Server Software: Net::Server::HTTP/2.009
Server Hostname: 192.168.103.24
Server Port: 80
Document Path: /
Document Length: 686 bytes
Concurrency Level: 1
Time taken for tests: 0.717 seconds
Complete requests: 6
Failed requests: 0
Total transferred: 4908 bytes
HTML transferred: 4116 bytes
Requests per second: 8.37 [#/sec] (mean)
Time per request: 119.431 [ms] (mean)
Time per request: 119.431 [ms] (mean, across all concurrent requests)
Transfer rate: 6.69 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 2 0.4 2 2
Processing: 7 117 121.0 219 234
Waiting: 4 5 0.6 5 6
Total: 9 119 121.1 221 236
################################################
But if I do it again or again then it finally fails with no more
connection possible:
ab -v4 -s10 -n6 http://192.168.103.24/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.103.24 (be patient)...INFO: GET header ==
---
GET / HTTP/1.0
Host: 192.168.103.24
User-Agent: ApacheBench/2.3
Accept: */*
---
apr_pollset_poll: The timeout specified has expired (70007)
I have no clue on what happens, the other side, the server, just stalls on this:
C:\Users\pc HP DV7>perl -e "use base qw(Net::Server::HTTP); main->run()"
2020/08/19-14:43:02 main (type Net::Server::HTTP -> MultiType -> Net::Server::PreFork) starting! pid(38588)
Resolved [*]:80 to [0.0.0.0]:80, IPv4
Host [*] resolved to IPv6 address [::] but IO::Socket::INET6->new fails: Invalid argument at C:/Strawberry/perl/site/lib/Net/Server/Proto.pm line 138.
Binding to TCP port 80 on host 0.0.0.0 with IPv4
Group Not Defined. Defaulting to EGID '0'
User Not Defined. Defaulting to EUID '0'
Thanks!
--
Au revoir,
Gilles Lamiral. France, Baulon (35580)
mob 06 19 22 03 54
tel 09 51 84 42 42
fax 09 56 84 42 42