www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chunyun Zhao" <cyz...@hotmail.com>
Subject Re: mod_rewrite/8177: Get HTTP errors when making multiple concurrent request to proxy module which rewrites url.
Date Tue, 14 Aug 2001 15:45:03 GMT
Actually I used our local web server for load testing, I just gave 
www.google.com as the example when I submitted the issue, sorry for the 
confusion.

I have tried out 2.3.14 for Win32 and 2.3.17 for Solaris, this problem 
doesn't exist. This is why I thought it is a bug of 2.3.19 for Win32.

Since I also don't know what that info from Silk Performer means, so I 
reproduced the bug using a simple java application successfully, the 
following are steps:

1. Add the following lines to httpd.conf to create a new proxy module:

  Listen 9000

  <VirtualHost zhao.mycompany.com:9000>
	ProxyRequests On

	ProxyVia On
	CacheRoot "c:/apache/proxy"
	CacheSize 5
	CacheGcInterval 4
	CacheMaxExpire 24
	CacheLastModifiedFactor 0.1
	CacheDefaultExpire 1

	RewriteEngine On
	RewriteLog c:/apache/logs/rewrite.log
	RewriteLogLevel 9
	RewriteCond %{HTTP_HOST}   !^zhao\.mycompany\.com
	# Use [P] to proxy/rewrite, [R] for a URL-decoration type rewrite
	RewriteRule ^proxy:(.+)    $1 [P]
</VirtualHost>


2. Restart Apache service.

3. Create the following Java application which can make multiple concurrent 
requests to the proxy, the source code are as follows:

import java.util.*;
import java.io.*;
import java.net.*;

public class HTTPPerformer
{
  private static int numberOfThreads;

  public static void main(String[] args)
  {
    try
    {
      //Use proxy server to get pages
      System.setProperty("http.proxyHost", "zhao.mycompany.com");
      System.setProperty("http.proxyPort", "9000");

      numberOfThreads = Integer.parseInt(args[0]);
      multiThreadTest();
    }
    catch (Exception e)
    {
      System.out.println("Exception in main: " + e);
      e.printStackTrace();
    }
  }

  private static void multiThreadTest()
  {
    for (int i = 0; i < numberOfThreads; i++)
    {
      MyThread myT = new MyThread(i);
      Thread t = new Thread(myT);
      t.start();
    }
  }

  static class MyThread implements Runnable
  {
    int counter;

    public MyThread(int i)
    {
      counter = i;
    }

    public void run()
    {
      try
      {
	String uri = "http://zhao.mycompany.com/load_testing.htm";
        URL url = new URL( uri );
        URLConnection conn = url.openConnection();
        InputStream is = conn.getInputStream();
        int b = is.read();
        while (b!=-1)
        {
          b = is.read();
        }
	System.out.println("Get the page successfully.");
        is.close();
      }
      catch (Exception e)
      {
        System.out.println(e);
        e.printStackTrace();
      }
    }
  }
}

4. Compile the Java application and run it, and the following are results 
from my console:

C:\temp>java HTTPPerformer 1
Get the page successfully.

C:\temp>java HTTPPerformer 2
Get the page successfully.
Get the page successfully.

C:\temp>java HTTPPerformer 3
Get the page successfully.
Get the page successfully.
Get the page successfully.

C:\temp>java HTTPPerformer 4
java.net.SocketException: Connection reset by peer: JVM_recv in socket input 
stream read

java.net.SocketException: Connection reset by peer: JVM_recv in socket input 
stream read java.net.SocketException: Connection reset by peer: JVM_recv in 
socket input stream read

java.net.SocketException: Connection reset by peer: JVM_recv in socket input 
stream read
        at java.net.SocketInputStream.socketRead(Native Method)

java.net.SocketException: Connection reset by peer: JVM_recv in socket input 
stream read
        at java.net.SocketInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at java.io.FilterInputStream.read(Unknown Source)
        at java.io.PushbackInputStream.read(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at HTTPPerformer$MyThread.run(HTTPPerformer.java:51)
        at java.lang.Thread.run(Unknown Source)
java.net.SocketException: Connection reset by peer: JVM_recv in socket input 
stream read
        at java.net.SocketInputStream.socketRead(Native Method)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at java.io.FilterInputStream.read(Unknown Source)
        at java.io.PushbackInputStream.read(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at HTTPPerformer$MyThread.run(HTTPPerformer.java:51)
        at java.lang.Thread.run(Unknown Source)
java.net.SocketException: Connection reset by peer: JVM_recv in socket input 
stream read
        at java.net.SocketInputStream.socketRead(Native Method)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at java.io.FilterInputStream.read(Unknown Source)
        at java.io.PushbackInputStream.read(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at HTTPPerformer$MyThread.run(HTTPPerformer.java:51)
        at java.lang.Thread.run(Unknown Source)
java.net.SocketException: Connection reset by peer: JVM_recv in socket input 
stream read
        at java.net.SocketInputStream.socketRead(Native Method)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at java.io.FilterInputStream.read(Unknown Source)
        at java.io.PushbackInputStream.read(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at HTTPPerformer$MyThread.run(HTTPPerformer.java:51)
        at java.lang.Thread.run(Unknown Source)

5. The above results show that when there are many concurrent requests made 
to the proxy, the socket connections are suddenly reset by Apache server 
proxy module.

6. I followed the above steps with Apache Server 2.3.14 for Win32, and it 
worked fine.

Thanks,
Charles

>From: marc@apache.org
>To: apache-bugdb@apache.org, cyzhao@hotmail.com, marc@apache.org
>Subject: Re: mod_rewrite/8177: Get HTTP errors when making multiple 
>concurrent request to proxy module which rewrites url.
>Date: 14 Aug 2001 05:00:30 -0000
>
>[In order for any reply to be added to the PR database, you need]
>[to include <apbugs@Apache.Org> in the Cc line and make sure the]
>[subject line starts with the report component and number, with ]
>[or without any 'Re:' prefixes (such as "general/1098:" or      ]
>["Re: general/1098:").  If the subject doesn't match this       ]
>[pattern, your message will be misfiled and ignored.  The       ]
>["apbugs" address is not added to the Cc line of messages from  ]
>[the database automatically because of the potential for mail   ]
>[loops.  If you do not include this Cc, your reply may be ig-   ]
>[nored unless you are responding to an explicit request from a  ]
>[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]
>
>
>Synopsis: Get HTTP errors when making multiple concurrent request to proxy 
>module which rewrites url.
>
>State-Changed-From-To: open-feedback
>State-Changed-By: marc
>State-Changed-When: Mon Aug 13 22:00:29 PDT 2001
>State-Changed-Why:
>Why are you load testing google's servers?  That doesn't seem very polite.
>
>What does the error you are getting actually mean?  We have no idea what 
>your load testing utility means when it gives that error.
>
>What makes you think this is anything more than intermittent connectivity 
>issues reaching google when you are stressing your internet connection 
>while bombarding it with requests?
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


Mime
View raw message