Loadtest

This is a discussion on Loadtest within the Apache Web Server forums, part of the Web Server and Related Forums category; I am writing a loadtester for our application, and I am testing against IIS/Tomcat versus Apache webserver/Tomcat. I ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-29-2006
ericwaite@gmail.com
 
Posts: n/a
Default Loadtest

I am writing a loadtester for our application, and I am testing against
IIS/Tomcat versus Apache webserver/Tomcat.
I am threading connections to the webserver by opening a socket and
writing to the outputstream.

Socket server = .....
OutputStream toServer = server.getOutputStream();
toServer.write(request);

My question is probably more on the webserver side, is this an
appropriate way to handle sending requests to a webserver,by opening
sockets? If I create a multi-threaded application and send 500
different requests, is this the same as 500 client browser requests, as
far as the webserver is concerned?

- Eric

  #2 (permalink)  
Old 06-29-2006
faxe
 
Posts: n/a
Default Re: Loadtest

ericwaite@gmail.com napisał(a):
> I am writing a loadtester for our application, and I am testing against
> IIS/Tomcat versus Apache webserver/Tomcat.
> I am threading connections to the webserver by opening a socket and
> writing to the outputstream.
>
> Socket server = .....
> OutputStream toServer = server.getOutputStream();
> toServer.write(request);
>
> My question is probably more on the webserver side, is this an
> appropriate way to handle sending requests to a webserver,by opening
> sockets? If I create a multi-threaded application and send 500
> different requests, is this the same as 500 client browser requests, as
> far as the webserver is concerned?


Hello,

there are many possibilities to do that. Let's look at Apache Benchmark
tool ("ab" binary in Apache's bin/ directory,
http://httpd.apache.org/docs/2.0/programs/ab.html):

* it can "employ" multiple threads ("-c" option) simulating a number of
client browsers accessing server resources at one time instead of
sending sequential requests
* it can use Keep-Alive HTTP option ("-k") to send requests without
disconnecting the socket (if server accepts it, of course)

There are also different types of threading models in Apache HTTP
Server. The mpm_prefork model uses new child processes to handle
incoming requests. So you'll probably get varying results when testing
threaded and non-threaded servers.

For example, the new experimental (used in Apache 2.2 only)
mpm_event_module is said to handle incomming connections better by
keeping helper-threads to do some initalization work instead of
taking listening (main) thread's time.

And yes, creating new threds to open sockets will cause the server to do
same things as it was real browsers. Although, to better simulate
real-world's browsers your tool should use Keep-Alive option sending
multiple requests (1 thread == N requests, N>1) until server sends
"Connection: Close" header in response (AFAIK it happens, when too much
clients want to have alive connection).

So, to simulate 500 real-world browsers, create 500 threads sending N
requests each. N can be random number in some range. IMO, that's the
best way to simulate heavy traffic on production server..

--
Pozdrawiam / Best regards
Pawel Zdziarski
gmail: faxepl
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:34 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0