develooper Front page | perl.libwww | Postings from July 2001

Re: Web Client Library BOF

Thread Previous
From:
Gisle Aas
Date:
July 25, 2001 12:28
Subject:
Re: Web Client Library BOF
Message ID:
lr3d7khkrh.fsf@caliper.ActiveState.com
Matt Sergeant <matt@sergeant.org> writes:

> Could this be to do with the fact that GHTTP is HTTP/1.1 only, and  maybe
> activestate's server is doing something odd with that? Maybe it's
> keepalive timeouts.

I don't think that is the case.  Other HTTP/1.1 implementations (like
Net::HTTP and HTTP::Webdav) does not have that problem.  The server is
MS-IIS/5.0.

There is a new connection for each request for both GHTTP and LWP.
What follows here is the strace log of a simple
connect/request/response/close exchange for GHTTP and LWP.  GHTTP end
up using 0.21s while LWP use 0.03 sec.  Since GHTTP always read the
data in 1024 byte chunks it ends up doing twice as many read calls as
LWP, but LWP will do a select call between each read.  My intuition
tells me LWP ought to be slower from this pattern.  Perhaps there is a
buffering issue with Linux when you don't read the whole package?

This is a GHTTP session:

16:27:52.132399 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4
16:27:52.132454 connect(4, {sin_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("192.168.2.91")}}, 16) = 0
16:27:52.133465 write(4, "GET / HTTP/1.1\r\n", 16) = 16
16:27:52.133559 write(4, "Host: www.activestate.com\r\nUser-"..., 55) = 55
16:27:52.133626 read(4, "HTTP/1.1 200 OK\r\nServer: Microso"..., 1024) = 1024
16:27:52.324409 read(4, "are,download,support,Perl Resour"..., 1024) = 1024
16:27:52.324503 read(4, " cellpadding=\"0\" cellspacing=\"0\""..., 1024) = 848
16:27:52.324566 read(4, "=\"#C2B266\" width=\"90\" align=\"cen"..., 1024) = 1024
16:27:52.325109 read(4, "\"100%\">\n\t<tr> \n\t\t<td valign=\"top"..., 1024) = 424
16:27:52.325171 read(4, "=\"0\" cellpadding=\"0\" bgcolor=\"#F"..., 1024) = 1024
16:27:52.326269 read(4, "l\"><b>Komodo and Tux coming to B"..., 1024) = 424
16:27:52.326331 read(4, "or Microsoft Visual Studio.NET</"..., 1024) = 1024
16:27:52.328989 read(4, "e\'re looking for people to work "..., 1024) = 424
16:27:52.329050 read(4, "              <br />\n           "..., 1024) = 1024
16:27:52.330202 read(4, "              <img src=\"/img/red"..., 1024) = 424
16:27:52.330299 read(4, "h=\"5\" height=\"7\" border=\"0\" alt="..., 1024) = 1024
16:27:52.331471 read(4, "\">ASPN Perl</a></b><br />\n      "..., 1024) = 424
16:27:52.331534 read(4, "                    <img src=\"/i"..., 1024) = 1024
16:27:52.334206 read(4, "              <img src=\"/img/red"..., 1024) = 424
16:27:52.334268 read(4, "bsp;<img src=\"/img/red_arrow.gif"..., 1024) = 1024
16:27:52.335421 read(4, "ght=\"7\" border=\"0\" alt=\"\" />\n   "..., 1024) = 424
16:27:52.335483 read(4, "    </tr>\n</table>\n  \n          "..., 1024) = 1024
16:27:52.336786 read(4, "c=\"/img/red_arrow.gif\" width=\"5\""..., 1024) = 424
16:27:52.336847 read(4, "rc=\"/img/ASPN_logo_smallest.gif\""..., 1024) = 1024
16:27:52.337998 read(4, "s/Komodo/\">download</a></b>  \n  "..., 1024) = 424
16:27:52.338058 read(4, "s/ActivePerl/More\">read more</a>"..., 1024) = 1024
16:27:52.339441 read(4, "VisualPython/More\">read more</a>"..., 1024) = 424
16:27:52.339501 read(4, "br />\n                        <b"..., 1024) = 1024
16:27:52.340663 read(4, "s/VisualXSLT/More\">read more</a>"..., 1024) = 424
16:27:52.340726 read(4, "       <br />\n                  "..., 1024) = 1024
16:27:52.341925 read(4, "ef=\"/Corporate/index.html\">Corpo"..., 1024) = 424
16:27:52.341986 read(4, "ml\">Site Map</a></td>\n\t\t\t\t\t\t\t\t\t\t"..., 1024) = 1024
16:27:52.343159 read(4, "->\n                        <a hr"..., 1024) = 424
16:27:52.343220 read(4, "</td>\n\n\t\t\t\t\t<td class=\"footer\" v"..., 1024) = 1024
16:27:52.344191 read(4, "rivacy statements -->\n\t\t\t\t\t\t<a h"..., 152) = 152
16:27:52.344480 fstat(3, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
16:27:52.344569 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40019000
16:27:52.344655 write(3, "<!DOCTYPE HTML PUBLIC \"-//W3C//D"..., 20480) = 20480
16:27:52.344891 rt_sigprocmask(SIG_BLOCK, NULL, [RT_0], 8) = 0
16:27:52.344968 close(4)                = 0

This is an LWP session:

16:32:54.729084 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
16:32:54.729161 fcntl(3, F_GETFL)       = 0x2 (flags O_RDWR)
16:32:54.729233 fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
16:32:54.729305 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40019000
16:32:54.729383 _llseek(3, 0, 0xbffff6f4, SEEK_CUR) = -1 ESPIPE (Illegal seek)
16:32:54.729454 fcntl(3, F_GETFL)       = 0x2 (flags O_RDWR)
16:32:54.729508 fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
16:32:54.729577 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001a000
16:32:54.729646 _llseek(3, 0, 0xbffff6e4, SEEK_CUR) = -1 ESPIPE (Illegal seek)
16:32:54.729695 fcntl(3, F_SETFD, FD_CLOEXEC) = 0
16:32:54.729967 fcntl(3, F_GETFL)       = 0x2 (flags O_RDWR)
16:32:54.730027 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
16:32:54.730097 connect(3, {sin_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("192.168.2.91")}}, 16) = -1 EINPROGRESS (Operation now in progress)
16:32:54.730475 open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
16:32:54.730564 open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
16:32:54.730903 select(8, NULL, [3], NULL, {180, 0}) = 1 (out [3], left {180, 0})
16:32:54.731548 connect(3, {sin_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("192.168.2.91")}}, 16) = 0
16:32:54.731641 brk(0x83bf000)          = 0x83bf000
16:32:54.731768 fcntl(3, F_GETFL)       = 0x802 (flags O_RDWR|O_NONBLOCK)
16:32:54.731824 fcntl(3, F_SETFL, O_RDWR) = 0
16:32:54.732894 select(8, NULL, [3], NULL, {180, 0}) = 1 (out [3], left {180, 0})
16:32:54.733189 write(3, "GET / HTTP/1.0\r\nHost: www.active"..., 75) = 75
16:32:54.733373 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.736523 brk(0x83c1000)          = 0x83c1000
16:32:54.736611 read(3, "HTTP/1.1 200 OK\r\nServer: Microso"..., 4096) = 1448
16:32:54.737215 brk(0x83c2000)          = 0x83c2000
16:32:54.738224 getpeername(3, {sin_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("192.168.2.91")}}, [16]) = 0
16:32:54.738686 getpeername(3, {sin_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("192.168.2.91")}}, [16]) = 0
16:32:54.739196 brk(0x83c3000)          = 0x83c3000
16:32:54.739330 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.739548 read(3, "rginheight=\"2\" marginwidth=\"4\">\n"..., 4096) = 1472
16:32:54.739689 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.740326 read(3, "ign=\"center\" nowrap=\"nowrap\"><a "..., 4096) = 1448
16:32:54.740455 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.741576 read(3, "olor=\"#FFFFFF\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t"..., 4096) = 1460
16:32:54.741682 brk(0x83c5000)          = 0x83c5000
16:32:54.741787 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.742872 read(3, "r><br>\n</td></tr>\n<!-- End of Pr"..., 4096) = 1448
16:32:54.743001 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.744163 read(3, " <div align=\"left\"><a href=\"/Pro"..., 4096) = 1484
16:32:54.744297 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.746996 read(3, "=\"/ASPN/Downloads/ActiveTcl/\">Ac"..., 4096) = 1448
16:32:54.747125 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.748253 read(3, "order=\"0\" alt=\"\" />\n            "..., 4096) = 1448
16:32:54.748488 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.749468 read(3, " />\n                        <b><"..., 4096) = 1448
16:32:54.749613 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.749784 read(3, "\"left\"><a hr", 4096) = 12
16:32:54.749886 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.750934 read(3, "ef=\"/Products/Components/PerlMx_"..., 4096) = 1448
16:32:54.751038 brk(0x83c9000)          = 0x83c9000
16:32:54.751144 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.752147 read(3, "=\"0\" alt=\"ASPN\"></a>\t\n\n         "..., 4096) = 1448
16:32:54.752272 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.753509 read(3, "ad</a></b>  \n                   "..., 4096) = 1472
16:32:54.753637 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.754812 read(3, "ownloads/PerlEx/\">download</a></"..., 4096) = 1448
16:32:54.754965 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.756086 read(3, "\"/ASPN/Downloads/Komodo/\">downlo"..., 4096) = 1448
16:32:54.756210 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.757382 read(3, "ap\"><a href=\"/Careers/index.html"..., 4096) = 1496
16:32:54.757516 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {179, 990000})
16:32:54.764942 read(3, "ailto:website-feedback@activesta"..., 4096) = 1020
16:32:54.765157 select(8, [3], NULL, NULL, {180, 0}) = 1 (in [3], left {180, 0})
16:32:54.765334 read(3, "", 4096)       = 0
16:32:54.765505 rt_sigprocmask(SIG_BLOCK, NULL, [RT_0], 8) = 0
16:32:54.765607 rt_sigprocmask(SIG_BLOCK, NULL, [RT_0], 8) = 0
16:32:54.765689 close(3)                = 0

Regards,
Gisle

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About