[fpc-pascal] CustHttpApp and HP httperf tool

silvioprog silvioprog at gmail.com
Fri Jun 6 17:38:25 CEST 2014


Hello,

I'm testing the CustHttpApp unit, and I found one error. See the httperf
logs below:

CGI (tested with FastCGI and it worked succefuly too):
-------
httperf --client=0/1 --server=127.0.0.1 --port=80
--uri=/cgi-bin/project1.cgi --rate=100 --send-buffer=4096
--recv-buffer=4096 --num-conns=1 --num-calls=2
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open
files to FD_SETSIZE
Maximum connect burst length: 0

Total: connections 1 requests 2 replies 2 test-duration 0.006 s

Connection rate: 178.3 conn/s (5.6 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 5.6 avg 5.6 max 5.6 median 5.5 stddev 0.0
Connection time [ms]: connect 0.1
Connection length [replies/conn]: 2.000

Request rate: 356.6 req/s (2.8 ms/req)
Request size [B]: 77.0

Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)
Reply time [ms]: response 2.8 transfer 0.0
Reply size [B]: header 191.0 content 11.0 footer 0.0 (total 202.0)
Reply status: 1xx=0 2xx=2 3xx=0 4xx=0 5xx=0

CPU time [s]: user 0.00 system 0.01 (user 0.0% system 99.5% total 99.5%)
Net I/O: 97.2 KB/s (0.8*10^6 bps)

Errors: *total 0* client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
-------

CustHttpApp:
-------
httperf --client=0/1 --server=127.0.0.1 --port=8080 --uri=/ --rate=100
--send-buffer=4096 --recv-buffer=4096 --num-conns=1 --num-calls=2
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open
files to FD_SETSIZE
Maximum connect burst length: 0

Total: connections 1 requests 2 replies 1 test-duration 0.002 s

Connection rate: 449.2 conn/s (2.2 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 2.2 avg 2.2 max 2.2 median 2.5 stddev 0.0
Connection time [ms]: connect 0.2
Connection length [replies/conn]: 1.000

Request rate: 898.4 req/s (1.1 ms/req)
Request size [B]: 62.0

Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)
Reply time [ms]: response 1.8 transfer 0.0
Reply size [B]: header 80.0 content 11.0 footer 0.0 (total 91.0)
Reply status: 1xx=0 2xx=1 3xx=0 4xx=0 5xx=0

CPU time [s]: user 0.00 system 0.00 (user 93.1% system 0.0% total 93.1%)
Net I/O: 94.3 KB/s (0.8*10^6 bps)

Errors: *total 1* client-timo 0 socket-timo 0 connrefused 0 connreset 1
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
-------

This is the code used in CustHttpApp test:

-------
program project1;

{$mode objfpc}{$H+}

uses
  cthreads,
  custhttpapp,
  custweb,
  HTTPDefs;

type

  { TMyHttpApplication }

  TMyHttpApplication = class(TCustomHttpApplication)
  protected
    function InitializeWebHandler: TWebHandler; override;
  end;

  { TMyHttpServerHandler }

  TMyHttpServerHandler = class(TFPHttpServerHandler)
  public
    procedure HandleRequest(ARequest: TRequest; AResponse: TResponse);
override;
  end;

  function TMyHttpApplication.InitializeWebHandler: TWebHandler;
  begin
    Result := TMyHttpServerHandler.Create(Self);
  end;

  procedure TMyHttpServerHandler.HandleRequest(ARequest: TRequest;
    AResponse: TResponse);
  begin
    AResponse.Contents.Text := 'testing it';
  end;

begin
  with TMyHttpApplication.Create(nil) do
    try
      Initialize;
      Port := 8080;
      Threaded := True;
      Run;
    finally
      Free;
    end;
end.
-------

Can you test it please?

My environment:

Lazarus 1.2.2 r44765 FPC 2.6.4 x86_64-linux-gtk 2

-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140606/f8ad38da/attachment.html>


More information about the fpc-pascal mailing list