errors that cause proxy to move worker to error state

2010-08-31 Thread Jeff Trawick
It looks like this is just 500 and 503.

Why not 400, for example?

if (access_status == OK)
break;
else if (access_status == HTTP_INTERNAL_SERVER_ERROR) {
/* Unrecoverable server error.
 * We can not failover to another worker.
 * Mark the worker as unusable if member of load balancer
 */
if (balancer) {
worker-s-status |= PROXY_WORKER_IN_ERROR;
worker-s-error_time = apr_time_now();
}
break;
}
else if (access_status == HTTP_SERVICE_UNAVAILABLE) {
/* Recoverable server error.
 * We can failover to another worker
 * Mark the worker as unusable if member of load balancer
 */
if (balancer) {
worker-s-status |= PROXY_WORKER_IN_ERROR;
worker-s-error_time = apr_time_now();
}
}
else {
/* Unrecoverable error.
 * Return the origin status code to the client.
 */
break;
}


Re: errors that cause proxy to move worker to error state

2010-08-31 Thread Andrew Oliver
A 400 doesn't indicate a problem with the worker or the system behind
the proxy, it indicates a problem with the client.  Also marking a
worker bad for say a 401 unauthorized would make all authentication
impossible, a 403 or 404 would drain the pool every time someone asked
for something they weren't allowed to have or that wasn't located
where they thought it was (especially spiders like google).

-Andy

On Tue, Aug 31, 2010 at 9:26 AM, Jeff Trawick traw...@gmail.com wrote:
 It looks like this is just 500 and 503.

 Why not 400, for example?

     if (access_status == OK)
     break;
     else if (access_status == HTTP_INTERNAL_SERVER_ERROR) {
     /* Unrecoverable server error.
  * We can not failover to another worker.
  * Mark the worker as unusable if member of load balancer
  */
     if (balancer) {
     worker-s-status |= PROXY_WORKER_IN_ERROR;
     worker-s-error_time = apr_time_now();
     }
     break;
     }
     else if (access_status == HTTP_SERVICE_UNAVAILABLE) {
     /* Recoverable server error.
  * We can failover to another worker
  * Mark the worker as unusable if member of load balancer
  */
     if (balancer) {
     worker-s-status |= PROXY_WORKER_IN_ERROR;
     worker-s-error_time = apr_time_now();
     }
     }
     else {
     /* Unrecoverable error.
  * Return the origin status code to the client.
  */
     break;
     }




Re: svn commit: r991180 - in /httpd/site/trunk: docs/download.html docs/index.html xdocs/download.xml xdocs/index.xml

2010-08-31 Thread Rainer Jung

Date typos noted inline.

On 31.08.2010 15:03, j...@apache.org wrote:

Author: jim
Date: Tue Aug 31 13:03:58 2010
New Revision: 991180

URL: http://svn.apache.org/viewvc?rev=991180view=rev
Log:
Updates for 2.3.8-alpha

Modified:
 httpd/site/trunk/docs/download.html
 httpd/site/trunk/docs/index.html
 httpd/site/trunk/xdocs/download.xml
 httpd/site/trunk/xdocs/index.xml

Modified: httpd/site/trunk/docs/download.html
URL: 
http://svn.apache.org/viewvc/httpd/site/trunk/docs/download.html?rev=991180r1=991179r2=991180view=diff
==
--- httpd/site/trunk/docs/download.html [utf-8] (original)
+++ httpd/site/trunk/docs/download.html [utf-8] Tue Aug 31 13:03:58 2010

...

@@ -198,19 +198,19 @@ by the project, and is recommended over
   tr
   td bgcolor=#828DA6
font color=#ff face=arial,helvetica,sanserif
-a name=apache23strongApache HTTP Server 2.3.6-alpha/strong/a
+a name=apache23strongApache HTTP Server 2.3.8-alpha/strong/a
/font
   /td
   td bgcolor=#828DA6 align=right
font color=#ff face=arial,helvetica,sanserif
-strong2010-01-28/strong
+strong2010-09-31/strong


2010-09-31 - 2010-08-31 ?


Modified: httpd/site/trunk/docs/index.html
URL: 
http://svn.apache.org/viewvc/httpd/site/trunk/docs/index.html?rev=991180r1=991179r2=991180view=diff
==
--- httpd/site/trunk/docs/index.html [utf-8] (original)
+++ httpd/site/trunk/docs/index.html [utf-8] Tue Aug 31 13:03:58 2010
@@ -155,19 +155,19 @@ Authentication/Authorization./p
   tr
   td bgcolor=#525D76
font color=#ff face=arial,helvetica,sanserif
-a name=2.3.6-alphastrongApache httpd 2.3.6-alpha Released/strong/a
+a name=2.3.8-alphastrongApache httpd 2.3.8-alpha Released/strong/a
/font
   /td
   td bgcolor=#525D76 align=right
font color=#ff face=arial,helvetica,sanserif
-strong2010-6-18/strong
+strong2010-08-18-31/strong


2010-08-18-31 - 2010-08-31


Modified: httpd/site/trunk/xdocs/download.xml
URL: 
http://svn.apache.org/viewvc/httpd/site/trunk/xdocs/download.xml?rev=991180r1=991179r2=991180view=diff
==
--- httpd/site/trunk/xdocs/download.xml [utf-8] (original)
+++ httpd/site/trunk/xdocs/download.xml [utf-8] Tue Aug 31 13:03:58 2010

...

@@ -127,10 +127,10 @@ by the project, and is recommended over

  /section

-section id=apache23 date=2010-01-28titleApache HTTP Server 
2.3.6-alpha/title
+section id=apache23 date=2010-09-31titleApache HTTP Server 
2.3.8-alpha/title


2010-09-31 - 2010-08-31 ?


Modified: httpd/site/trunk/xdocs/index.xml
URL: 
http://svn.apache.org/viewvc/httpd/site/trunk/xdocs/index.xml?rev=991180r1=991179r2=991180view=diff
==
--- httpd/site/trunk/xdocs/index.xml [utf-8] (original)
+++ httpd/site/trunk/xdocs/index.xml [utf-8] Tue Aug 31 13:03:58 2010
@@ -77,12 +77,12 @@ Authentication/Authorization./p

  /section

-section id=2.3.6-alpha date=2010-6-18
-titleApache httpd 2.3.6-alpha Released/title
+section id=2.3.8-alpha date=2010-08-18-31


2010-08-18-31 - 2010-08-31

Regards,

Rainer


RE: errors that cause proxy to move worker to error state

2010-08-31 Thread Plüm, Rüdiger, VF-Group
A 400 does not mean that the backend is not available. It just means that
a bad request was sent. In addition to what is directly delivered from the 
backend
the proxy code itself uses 500 and 503 to signal the balancer code that the 
error
it faced (in case there was no response code from the backend for whatever 
reason)
was recoverable (503) or not (500)
 
Regards
 
Rüdiger




From: Jeff Trawick [mailto:traw...@gmail.com] 
Sent: Dienstag, 31. August 2010 15:26
To: dev@httpd.apache.org
Subject: errors that cause proxy to move worker to error state


It looks like this is just 500 and 503.

Why not 400, for example?

if (access_status == OK)
break;
else if (access_status == HTTP_INTERNAL_SERVER_ERROR) {
/* Unrecoverable server error.
 * We can not failover to another worker.
 * Mark the worker as unusable if member of load balancer
 */
if (balancer) {
worker-s-status |= PROXY_WORKER_IN_ERROR;
worker-s-error_time = apr_time_now();
}
break;
}
else if (access_status == HTTP_SERVICE_UNAVAILABLE) {
/* Recoverable server error.
 * We can failover to another worker
 * Mark the worker as unusable if member of load balancer
 */
if (balancer) {
worker-s-status |= PROXY_WORKER_IN_ERROR;
worker-s-error_time = apr_time_now();
}
}
else {
/* Unrecoverable error.
 * Return the origin status code to the client.
 */
break;
}





Re: errors that cause proxy to move worker to error state

2010-08-31 Thread Jeff Trawick
On Tue, Aug 31, 2010 at 9:33 AM, Andrew Oliver acoli...@gmail.com wrote:

 A 400 doesn't indicate a problem with the worker or the system behind
 the proxy, it indicates a problem with the client.


It could indicate that proxy is confused about what it sent though (in the
presence of some mod_proxy defect).  That's what bugs me about it.  That
doesn't seem to be a good time to keep using the connection.



  Also marking a
 worker bad for say a 401 unauthorized would make all authentication
 impossible, a 403 or 404 would drain the pool every time someone asked
 for something they weren't allowed to have or that wasn't located
 where they thought it was (especially spiders like google).


Sure, other 40xs are fine.





 -Andy

 On Tue, Aug 31, 2010 at 9:26 AM, Jeff Trawick traw...@gmail.com wrote:
  It looks like this is just 500 and 503.
 
  Why not 400, for example?
 
  if (access_status == OK)
  break;
  else if (access_status == HTTP_INTERNAL_SERVER_ERROR) {
  /* Unrecoverable server error.
   * We can not failover to another worker.
   * Mark the worker as unusable if member of load balancer
   */
  if (balancer) {
  worker-s-status |= PROXY_WORKER_IN_ERROR;
  worker-s-error_time = apr_time_now();
  }
  break;
  }
  else if (access_status == HTTP_SERVICE_UNAVAILABLE) {
  /* Recoverable server error.
   * We can failover to another worker
   * Mark the worker as unusable if member of load balancer
   */
  if (balancer) {
  worker-s-status |= PROXY_WORKER_IN_ERROR;
  worker-s-error_time = apr_time_now();
  }
  }
  else {
  /* Unrecoverable error.
   * Return the origin status code to the client.
   */
  break;
  }
 
 




-- 
Born in Roswell... married an alien...


Re: errors that cause proxy to move worker to error state

2010-08-31 Thread Jeff Trawick
On Tue, Aug 31, 2010 at 9:40 AM, Plüm, Rüdiger, VF-Group 
ruediger.pl...@vodafone.com wrote:

  A 400 does not mean that the backend is not available.


agreed


 It just means that
 a bad request was sent.


I don't like that part ;)   Maybe mod_proxy mangled what got sent (sent too
much body on prior request?).


In addition to what is directly delivered from the backend
 the proxy code itself uses 500 and 503 to signal the balancer code that the
 error
 it faced (in case there was no response code from the backend for whatever
 reason)
 was recoverable (503) or not (500)

 Regards

 Rüdiger

  --
 *From:* Jeff Trawick [mailto:traw...@gmail.com]
 *Sent:* Dienstag, 31. August 2010 15:26
 *To:* dev@httpd.apache.org
 *Subject:* errors that cause proxy to move worker to error state

 It looks like this is just 500 and 503.

 Why not 400, for example?

 if (access_status == OK)
 break;
 else if (access_status == HTTP_INTERNAL_SERVER_ERROR) {
 /* Unrecoverable server error.
  * We can not failover to another worker.
  * Mark the worker as unusable if member of load balancer
  */
 if (balancer) {
 worker-s-status |= PROXY_WORKER_IN_ERROR;
 worker-s-error_time = apr_time_now();
 }
 break;
 }
 else if (access_status == HTTP_SERVICE_UNAVAILABLE) {
 /* Recoverable server error.
  * We can failover to another worker
  * Mark the worker as unusable if member of load balancer
  */
 if (balancer) {
 worker-s-status |= PROXY_WORKER_IN_ERROR;
 worker-s-error_time = apr_time_now();
 }
 }
 else {
 /* Unrecoverable error.
  * Return the origin status code to the client.
  */
 break;
 }




-- 
Born in Roswell... married an alien...


Re: svn commit: r991180 - in /httpd/site/trunk: docs/download.html docs/index.html xdocs/download.xml xdocs/index.xml

2010-08-31 Thread Rainer Jung

I fixed it. Sorry for the noise.

On 31.08.2010 15:38, Rainer Jung wrote:

Date typos noted inline.

On 31.08.2010 15:03, j...@apache.org wrote:

Author: jim
Date: Tue Aug 31 13:03:58 2010
New Revision: 991180

URL: http://svn.apache.org/viewvc?rev=991180view=rev
Log:
Updates for 2.3.8-alpha

Modified:
httpd/site/trunk/docs/download.html
httpd/site/trunk/docs/index.html
httpd/site/trunk/xdocs/download.xml
httpd/site/trunk/xdocs/index.xml

Modified: httpd/site/trunk/docs/download.html
URL:
http://svn.apache.org/viewvc/httpd/site/trunk/docs/download.html?rev=991180r1=991179r2=991180view=diff

==

--- httpd/site/trunk/docs/download.html [utf-8] (original)
+++ httpd/site/trunk/docs/download.html [utf-8] Tue Aug 31 13:03:58 2010

...

@@ -198,19 +198,19 @@ by the project, and is recommended over
tr
td bgcolor=#828DA6
font color=#ff face=arial,helvetica,sanserif
-a name=apache23strongApache HTTP Server 2.3.6-alpha/strong/a
+a name=apache23strongApache HTTP Server 2.3.8-alpha/strong/a
/font
/td
td bgcolor=#828DA6 align=right
font color=#ff face=arial,helvetica,sanserif
-strong2010-01-28/strong
+strong2010-09-31/strong


2010-09-31 - 2010-08-31 ?


Modified: httpd/site/trunk/docs/index.html
URL:
http://svn.apache.org/viewvc/httpd/site/trunk/docs/index.html?rev=991180r1=991179r2=991180view=diff

==

--- httpd/site/trunk/docs/index.html [utf-8] (original)
+++ httpd/site/trunk/docs/index.html [utf-8] Tue Aug 31 13:03:58 2010
@@ -155,19 +155,19 @@ Authentication/Authorization./p
tr
td bgcolor=#525D76
font color=#ff face=arial,helvetica,sanserif
-a name=2.3.6-alphastrongApache httpd 2.3.6-alpha
Released/strong/a
+a name=2.3.8-alphastrongApache httpd 2.3.8-alpha
Released/strong/a
/font
/td
td bgcolor=#525D76 align=right
font color=#ff face=arial,helvetica,sanserif
-strong2010-6-18/strong
+strong2010-08-18-31/strong


2010-08-18-31 - 2010-08-31


Modified: httpd/site/trunk/xdocs/download.xml
URL:
http://svn.apache.org/viewvc/httpd/site/trunk/xdocs/download.xml?rev=991180r1=991179r2=991180view=diff

==

--- httpd/site/trunk/xdocs/download.xml [utf-8] (original)
+++ httpd/site/trunk/xdocs/download.xml [utf-8] Tue Aug 31 13:03:58 2010

...

@@ -127,10 +127,10 @@ by the project, and is recommended over

/section

-section id=apache23 date=2010-01-28titleApache HTTP Server
2.3.6-alpha/title
+section id=apache23 date=2010-09-31titleApache HTTP Server
2.3.8-alpha/title


2010-09-31 - 2010-08-31 ?


Modified: httpd/site/trunk/xdocs/index.xml
URL:
http://svn.apache.org/viewvc/httpd/site/trunk/xdocs/index.xml?rev=991180r1=991179r2=991180view=diff

==

--- httpd/site/trunk/xdocs/index.xml [utf-8] (original)
+++ httpd/site/trunk/xdocs/index.xml [utf-8] Tue Aug 31 13:03:58 2010
@@ -77,12 +77,12 @@ Authentication/Authorization./p

/section

-section id=2.3.6-alpha date=2010-6-18
-titleApache httpd 2.3.6-alpha Released/title
+section id=2.3.8-alpha date=2010-08-18-31


2010-08-18-31 - 2010-08-31

Regards,

Rainer


Re: errors that cause proxy to move worker to error state

2010-08-31 Thread Rainer Jung

On 31.08.2010 15:44, Jeff Trawick wrote:

On Tue, Aug 31, 2010 at 9:40 AM, Plüm, Rüdiger, VF-Group
ruediger.pl...@vodafone.com mailto:ruediger.pl...@vodafone.com wrote:

A 400 does not mean that the backend is not available.


agreed

It just means that
a bad request was sent.


I don't like that part ;)   Maybe mod_proxy mangled what got sent (sent
too much body on prior request?).


So that could result in close this backend connection not put into 
error state as a reaction, right?


Regards,

Rainer


[ANNOUNCEMENT] Apache HTTP Server 2.3.8-alpha Released

2010-08-31 Thread Jim Jagielski
Apache HTTP Server 2.3.8-alpha Released

   The Apache Software Foundation and the Apache HTTP Server Project are
   pleased to announce the release of version 2.3.8-alpha of the Apache HTTP
   Server (Apache).  This version of Apache is principally an alpha release
   to test new technology and features that are incompatible or too large for
   the stable 2.2.x branch. This alpha release should not be presumed to
   be compatible with binaries built against any prior or future version.

   This release is expected to be the last alpha release; subsequent releases
   will be beta releases as we move towards 2.4.0-GA.

   
   Apache HTTP Server 2.3.8-alpha is available for download from:

 http://httpd.apache.org/download.cgi

   Apache 2.3 offers numerous enhancements, improvements, and performance
   boosts over the 2.2 codebase.  For an overview of new features
   introduced since 2.3 please see:

 http://httpd.apache.org/docs/trunk/new_features_2_4.html

   Please see the CHANGES_2.3 file, linked from the download page, for a
   full list of changes.
   
   This release includes the Apache Portable Runtime (APR) version 1.4.2
   and APR-Util version 1.3.9 in a separate -deps tarball.  The APR libraries
   must be upgraded for all features of httpd to operate correctly.

   This release builds on and extends the Apache 2.2 API.  Modules written
   for Apache 2.2 will need to be recompiled in order to run with Apache
   2.3, and require minimal or no source code changes.

 http://svn.apache.org/repos/asf/httpd/httpd/trunk/VERSIONING


Re: errors that cause proxy to move worker to error state

2010-08-31 Thread Jeff Trawick
On Tue, Aug 31, 2010 at 9:58 AM, Rainer Jung rainer.j...@kippdata.dewrote:

 On 31.08.2010 15:44, Jeff Trawick wrote:

 On Tue, Aug 31, 2010 at 9:40 AM, Plüm, Rüdiger, VF-Group
 ruediger.pl...@vodafone.com mailto:ruediger.pl...@vodafone.com wrote:

A 400 does not mean that the backend is not available.


 agreed

It just means that
a bad request was sent.


 I don't like that part ;)   Maybe mod_proxy mangled what got sent (sent
 too much body on prior request?).


 So that could result in close this backend connection not put into error
 state as a reaction, right?


Yes (I forgot or didn't know the distinction between closing a particular
connection and marking the worker in error)

At present we don't mark particular connections for close just based on the
status code without marking the worker in error, right?

Anyway, my question should have been

Should we close backend connections if we get 400?

Thanks,

Jeff


RE: errors that cause proxy to move worker to error state

2010-08-31 Thread Plüm, Rüdiger, VF-Group
 




From: Jeff Trawick [mailto:traw...@gmail.com] 
Sent: Dienstag, 31. August 2010 16:25
To: dev@httpd.apache.org
Subject: Re: errors that cause proxy to move worker to error state


On Tue, Aug 31, 2010 at 9:58 AM, Rainer Jung rainer.j...@kippdata.de 
wrote:


On 31.08.2010 15:44, Jeff Trawick wrote:


On Tue, Aug 31, 2010 at 9:40 AM, Plüm, Rüdiger, 
VF-Group

ruediger.pl...@vodafone.com 
mailto:ruediger.pl...@vodafone.com wrote:

   A 400 does not mean that the backend is not 
available.


agreed

   It just means that
   a bad request was sent.


I don't like that part ;)   Maybe mod_proxy mangled 
what got sent (sent
too much body on prior request?).



So that could result in close this backend connection not 
put into error state as a reaction, right?



Yes (I forgot or didn't know the distinction between closing a 
particular connection and marking the worker in error)

At present we don't mark particular connections for close just based on 
the status code without marking the worker in error, right?

Anyway, my question should have been

Should we close backend connections if we get 400? 
 
Seems reasonable at least for mod_proxy_http to avoid further possible 
harm on that connection.
 
Regards
 
Rüdiger
 

 



Re: errors that cause proxy to move worker to error state

2010-08-31 Thread Jim Jagielski

On Aug 31, 2010, at 10:24 AM, Jeff Trawick wrote:

 On Tue, Aug 31, 2010 at 9:58 AM, Rainer Jung rainer.j...@kippdata.de wrote:
 On 31.08.2010 15:44, Jeff Trawick wrote:
 On Tue, Aug 31, 2010 at 9:40 AM, Plüm, Rüdiger, VF-Group
 ruediger.pl...@vodafone.com mailto:ruediger.pl...@vodafone.com wrote:
 
A 400 does not mean that the backend is not available.
 
 
 agreed
 
It just means that
a bad request was sent.
 
 
 I don't like that part ;)   Maybe mod_proxy mangled what got sent (sent
 too much body on prior request?).
 
 So that could result in close this backend connection not put into error 
 state as a reaction, right?
 
 Yes (I forgot or didn't know the distinction between closing a particular 
 connection and marking the worker in error)
 
 At present we don't mark particular connections for close just based on the 
 status code without marking the worker in error, right?
 
 Anyway, my question should have been
 
 Should we close backend connections if we get 400?
 

For now, yeah. Likely safer.



Apache Input Filter

2010-08-31 Thread Varanasi, Sasikala
Hi,
 
I have a need to capture the incoming request body each time a request
comes into Apache Proxy server. I have mod_proxy and mod_filters setup
and I have an input filter that I wrote that captures the payload from
the request and logs it out. The input filter is able to do this,
however, the filter is processing the same request twice. The input
filter gets invoked 7-8 times for each request, most of the time with
empty buf on apr_bucket_read and twice with the same request contents.
What do I need to do to change the filter not to process the request
contents twice? How do I know the request has been already processed
once? Here is the part of the code that I have in the filter. Anything
that I missed? thank you in advance for your help.
 
if (ap_is_initial_req(r)) {
   if ( ret = ap_get_brigade(f-next, bb, mode, block, nbytes), ret ==
APR_SUCCESS ) {
const char* buf;
for ( b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b =
APR_BUCKET_NEXT(b) )
{
 

   int len;
   if (apr_bucket_read(b,buf,bytes,APR_NONBLOCK_READ)
== APR_SUCCESS) {
  read = 1;
   }
 
}
 
//if anything is read, send out the payload
if (read == 1) {
 //check if buf is all empty
 char *newbuf = stripspaces(buf);
 int l = strlen(newbuf);

 

 if (l == 0 || l == 1) {
 
fprintf(stderr, the buf length is 0 or 1 - all empty!
not sending data \n);
 } else   {
 
fprintf(stderr, unparsed uri is: %s \n,
r-unparsed_uri);
 

fprintf(stderr, The request buf is --- %s,
buf);
 
   }
   }
 }
  }
  return ret ;


Apache-Benchmark: Non cumulative values

2010-08-31 Thread Samuel ROZE
Hello,

I'm using Apache-Benchmark to stats my applications performances. I
want to create a graph, using GNUPlot and Apache Benchmark.
The -g option create a file that I can load in GNUPlot. It works
very well but requests times are cumulative values:

3150
3168
3172
3194
3203
3215
3220
3225
3227
3231

I just want the real request time values, like that:

18
4
12
9
12
5
...

Is it possible using Apache-Benchmark tool, or have I to use an other
tool to transform values, like sed, awk... I tried with these tools
but I failed. Is there a solution?


NB: Should I change of mailing-list for questions like that? If yes, sorry...
Regards,
Samuel ROZE.


Re: Apache-Benchmark: Non cumulative values

2010-08-31 Thread ricardo figueiredo
Hi,

Would you like to use any SpreadSheet program for this ??

--
Muito Obrigado
Ricardo


On Tue, Aug 31, 2010 at 12:01 PM, Samuel ROZE samuel.r...@gmail.com wrote:

 Hello,

 I'm using Apache-Benchmark to stats my applications performances. I
 want to create a graph, using GNUPlot and Apache Benchmark.
 The -g option create a file that I can load in GNUPlot. It works
 very well but requests times are cumulative values:

 3150
 3168
 3172
 3194
 3203
 3215
 3220
 3225
 3227
 3231

 I just want the real request time values, like that:

 18
 4
 12
 9
 12
 5
 ...

 Is it possible using Apache-Benchmark tool, or have I to use an other
 tool to transform values, like sed, awk... I tried with these tools
 but I failed. Is there a solution?


 NB: Should I change of mailing-list for questions like that? If yes,
 sorry...
 Regards,
 Samuel ROZE.



Re: Apache-Benchmark: Non cumulative values

2010-08-31 Thread Samuel ROZE
No, I would like to just use bash commands. It'll made automatically
on each important code modification.

2010/8/31 ricardo figueiredo ricardoogra...@gmail.com:
 Hi,

 Would you like to use any SpreadSheet program for this ??

 --
 Muito Obrigado
 Ricardo


 On Tue, Aug 31, 2010 at 12:01 PM, Samuel ROZE samuel.r...@gmail.com wrote:

 Hello,

 I'm using Apache-Benchmark to stats my applications performances. I
 want to create a graph, using GNUPlot and Apache Benchmark.
 The -g option create a file that I can load in GNUPlot. It works
 very well but requests times are cumulative values:

 3150
 3168
 3172
 3194
 3203
 3215
 3220
 3225
 3227
 3231

 I just want the real request time values, like that:

 18
 4
 12
 9
 12
 5
 ...

 Is it possible using Apache-Benchmark tool, or have I to use an other
 tool to transform values, like sed, awk... I tried with these tools
 but I failed. Is there a solution?


 NB: Should I change of mailing-list for questions like that? If yes,
 sorry...
 Regards,
 Samuel ROZE.




Re: Apache-Benchmark: Non cumulative values

2010-08-31 Thread Rainer Jung

On 31.08.2010 17:01, Samuel ROZE wrote:

Hello,

I'm using Apache-Benchmark to stats my applications performances. I
want to create a graph, using GNUPlot and Apache Benchmark.
The -g option create a file that I can load in GNUPlot. It works
very well but requests times are cumulative values:

3150
3168
3172
3194
3203
3215
3220
3225
3227
3231

I just want the real request time values, like that:

18
4
12
9
12
5
...

Is it possible using Apache-Benchmark tool, or have I to use an other
tool to transform values, like sed, awk... I tried with these tools
but I failed. Is there a solution?


NB: Should I change of mailing-list for questions like that? If yes, sorry...


Yes, that's a question for the users list (us...@httpd.apache.org).

Please repost your question there.

As a partial answer: I never used the -g switch, but the wanted 
transform using awk would look like this:


awk 's0 {print $0-s} s={$0}'

if you don't want to print the value in the first line, or simply

awk '{print $0-s;s=$0}'

if the first line is equal to the first value (non-cumulated).

Regards,

Rainer


Re: Apache-Benchmark: Non cumulative values

2010-08-31 Thread Dirk-Willem van Gulik

On 31 Aug 2010, at 16:01, Samuel ROZE wrote:

 I'm using Apache-Benchmark to stats my applications performances. I
 want to create a graph, using GNUPlot and Apache Benchmark.
 The -g option create a file that I can load in GNUPlot. It works
 very well but requests times are cumulative values:

And the third field, labelled dtime, is not what you want ?

Dw.


Re: Apache-Benchmark: Non cumulative values

2010-08-31 Thread Stefan Ruppert

Hi Samuel,

maybe you are interested in the mod_arm4 module 
(http://svn.apache.org/repos/asf/httpd/sandbox/mod_arm4/)
which measures any HTTP request by using the Application Response 
Measurement (ARM) standard. All you need is an implementation of an ARM 
agent and you'll get the response time of any served HTTP request.


A free of charge community edition and an optimized mod_arm4 module is 
provided by my own company. Have a look at http://www.myarm.com


Regards,
Stefan



Re: Apache-Benchmark: Non cumulative values

2010-08-31 Thread Samuel ROZE
Is it the ctime field ? I think that the dtime field is the
downloaded time but I'm not sure... What's the ctime field? I use
the wait field because I think that is the time while
Apache-Benchmark is waiting the server response, but I'm not sure
too...

An other question is: is it really cumulative values? I'm in trouble
because some values like 60 or between 100 values.

Samuel.

2010/8/31 Dirk-Willem van Gulik di...@webweaving.org:

 On 31 Aug 2010, at 16:01, Samuel ROZE wrote:

 I'm using Apache-Benchmark to stats my applications performances. I
 want to create a graph, using GNUPlot and Apache Benchmark.
 The -g option create a file that I can load in GNUPlot. It works
 very well but requests times are cumulative values:

 And the third field, labelled dtime, is not what you want ?

 Dw.



Re: Apache-Benchmark: Non cumulative values

2010-08-31 Thread Samuel ROZE
That works very well! Thanks a lot!

2010/8/31 Rainer Jung rainer.j...@kippdata.de:
 On 31.08.2010 17:01, Samuel ROZE wrote:

 Hello,

 I'm using Apache-Benchmark to stats my applications performances. I
 want to create a graph, using GNUPlot and Apache Benchmark.
 The -g option create a file that I can load in GNUPlot. It works
 very well but requests times are cumulative values:

 3150
 3168
 3172
 3194
 3203
 3215
 3220
 3225
 3227
 3231

 I just want the real request time values, like that:

 18
 4
 12
 9
 12
 5
 ...

 Is it possible using Apache-Benchmark tool, or have I to use an other
 tool to transform values, like sed, awk... I tried with these tools
 but I failed. Is there a solution?


 NB: Should I change of mailing-list for questions like that? If yes,
 sorry...

 Yes, that's a question for the users list (us...@httpd.apache.org).

 Please repost your question there.

 As a partial answer: I never used the -g switch, but the wanted transform
 using awk would look like this:

 awk 's0 {print $0-s} s={$0}'

 if you don't want to print the value in the first line, or simply

 awk '{print $0-s;s=$0}'

 if the first line is equal to the first value (non-cumulated).

 Regards,

 Rainer



Re: Apache-Benchmark: Non cumulative values

2010-08-31 Thread Samuel ROZE
I just have a last question: what's the difference between theses results:

Time per request:   3426.206 [ms] (mean)
Time per request:   342.621 [ms] (mean, across all concurrent requests)

Thanks in advance!
Samuel ROZE.

2010/8/31 Samuel ROZE samuel.r...@gmail.com:
 Hello,

 I'm using Apache-Benchmark to stats my applications performances. I
 want to create a graph, using GNUPlot and Apache Benchmark.
 The -g option create a file that I can load in GNUPlot. It works
 very well but requests times are cumulative values:

 3150
 3168
 3172
 3194
 3203
 3215
 3220
 3225
 3227
 3231

 I just want the real request time values, like that:

 18
 4
 12
 9
 12
 5
 ...

 Is it possible using Apache-Benchmark tool, or have I to use an other
 tool to transform values, like sed, awk... I tried with these tools
 but I failed. Is there a solution?


 NB: Should I change of mailing-list for questions like that? If yes, sorry...
 Regards,
 Samuel ROZE.



rational behind not checking the return value of apr_palloc and apr_pcalloc

2010-08-31 Thread dave b
What is the rational behind not checking the return value of
apr_palloc and apr_pcalloc?


code memory/unix/apr_pools.c from apr-1.4.2
APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size);
APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size)
{
void *mem;

if ((mem = apr_palloc(pool, size)) != NULL) {
memset(mem, 0, size);
}

return mem;
}

and
apr_palloc can return NULL.
So I modified the code and the testdir test failed in one place -

node = active-next;
if (size = node_free_space(node)) {
list_remove(node);
}
else {
if ((node = allocator_alloc(pool-allocator, size)) == NULL) {
if (pool-abort_fn)
pool-abort_fn(APR_ENOMEM); /* HERE */

return NULL;
}
}

When you run the testdir (test). If you change the above to be:


.
if ((node = allocator_alloc(pool-allocator, size)) == NULL) {
if (!   pool-abort_fn) /* note the ! added */
pool-abort_fn(APR_ENOMEM);

return NULL; /* you end up here */
}
}
and you will fail one of the tests. This to me suggests that this scenario is
possible if the pool is like that one failed test *but* pool-abort_fn is not
true :)


So what is the rational behind most users of these method *not*
checking the return code - because from what I have seen / know it is
possible return NULL.

Also see:  https://issues.apache.org/bugzilla/show_bug.cgi?id=49847


Re: rational behind not checking the return value of apr_palloc and apr_pcalloc

2010-08-31 Thread Graham Dumpleton
On 1 September 2010 14:07, dave b db.pub.m...@gmail.com wrote:
 What is the rational behind not checking the return value of
 apr_palloc and apr_pcalloc?

Specifically here talking about why HTTPD code doesn't check. Ie.,
core server code and modules supplied with HTTPD.

I am clarifying this because he is hitting up on me as to why mod_wsgi
doesn't do it, yet the HTTPD code itself doesn't do it and I am just
following that precedent. So suggested he ask here why there is no
practice of checking for NULL values in HTTPD code when doing
allocations against pools. :-)

Graham

 code memory/unix/apr_pools.c from apr-1.4.2
 APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size);
 APR_DECLARE(void *) apr_pcalloc(apr_pool_t *pool, apr_size_t size)
 {
    void *mem;

    if ((mem = apr_palloc(pool, size)) != NULL) {
        memset(mem, 0, size);
    }

    return mem;
 }

 and
 apr_palloc can return NULL.
 So I modified the code and the testdir test failed in one place -

     node = active-next;
    if (size = node_free_space(node)) {
        list_remove(node);
    }
    else {
        if ((node = allocator_alloc(pool-allocator, size)) == NULL) {
            if (pool-abort_fn)
                pool-abort_fn(APR_ENOMEM); /* HERE */

            return NULL;
        }
    }

 When you run the testdir (test). If you change the above to be:


 .
        if ((node = allocator_alloc(pool-allocator, size)) == NULL) {
            if (!   pool-abort_fn) /* note the ! added */
                pool-abort_fn(APR_ENOMEM);

            return NULL; /* you end up here */
        }
    }
 and you will fail one of the tests. This to me suggests that this scenario is
 possible if the pool is like that one failed test *but* pool-abort_fn is not
 true :)
 

 So what is the rational behind most users of these method *not*
 checking the return code - because from what I have seen / know it is
 possible return NULL.

 Also see:  https://issues.apache.org/bugzilla/show_bug.cgi?id=49847