Socrates
"The unexamined web site is not worth serving"

14, February 1998


What It Is

In the tradition founded by the ancient philosopher, Socrates is a tool that allows you to learn by asking questions.

This application is a tool for testing the performance of your web site, CGI's, plug-in's, or server side DLL's under a heavy load.

Socrates allows you to simulate many virtual web clients from one machine.

You can configure what files to request, what kind of delays, and how many times to make requests in order to simulate a diverse set of load conditions. It is possible to make these test repeatable, try that with several friends or coworkers all pounding your site on your command!

This application provides an easy way to test your web site.

Socrates can also be configured to watch your web server and beep if the web site stops responding.

Socrates provides a minimal level of cookie support. Each virtual client can store and send one cookie. Once a cookie has been set for a virtual client, it will be sent for every subsequent request.

What It Is Not

Socrates is not meant to be used for generating comparative benchmarks between different web servers. There are tools available that provide a standard set of documents and a rigorous set of testing criteria such as:

Software QA/Test Resource Centerhttp://www.charm.net/~dmg/qatest/qatweb1.html
WebBenchhttp://www.zdnet.com/zdbop/webbench/webbench.html
WebStonehttp://www.mindcraft.com/webstone/
Mercury Astra TestSitehttp://www.merc-int.com/products/astraguide.html
Others??Send me e-mail and I'll update this doc

Socrates is not meant to used as a weapon. See Net Etiquette below.

Socrates will not automatically find and test all of the links in your site. Perhaps in another version if the clamoring of the masses is sufficient.

What Do I Need

How Do I Use It

The first thing that you must do is to place a file named socrates.txt in the document root of your web server. It's contents do not matter, but it must contain some data in order for your web server to serve the file. When Socrates begins to query a server, it will initially request a file named socrates.txt. If the file does not exist, then Socrates will not query the web server. This is to ensure that only authorized people query their servers.

Configuration

Socrates is configured through a configuration file. The default configuration file name is socrates.conf. This file is composed of multiple lines, each containing a [tag] [value] pair. These pairs must be separated by a tab or space. Capitalization is not important. A final blank line IS required as the last line in the configuration file.

The possible configuration file entries are:

TagValueExample
keyThis is the key that I send you to get rid of the nag dialog. You must send me a real, live picture Post Card with your e-mail address.
hostThis is the host that you want to test. It can be an IP address or a host name. If your DNS can recognize it, then it is valid. Do not provide the protocol portion of the URL (i.e. http://) localhost
www.morphtech.com
206.239.78.10
proxyThis is the name of a proxy server, if you must communicate through one. It can be an IP address or a host name. If your DNS can recognize it, then it is valid. proxyhost
proxy.morphtech.com
206.239.78.10
portThis is the port that the server is listening on. The standard HTTP port is 80. 80
8080
secportThis is the port that the server is listening on for SSL connections. The standard HTTPS port is 443. 443
secureCheckThis settting is used to force Socrates to use a secure connection when checking for the socrates.txt file. The default value is 0. 1 - Force a secure check
0 - Use standard HTTP
clientsThis is the number of clients to simulate. 1
10
delayThis is how many milliseconds to delay between staring each clients. 300
10
pauseThis is how many milliseconds each client waits after a connection before attempting another. 200
10
lurkA value of 1 means Socrates will run in LURK mode. The default value is 0. 0
1
usernameThe username to use for ALL page requests. Only Basic Authentification is supported. foo
passwordThe password to use for ALL page requests. Only Basic Authentification is supported. bar
iterationsThis is how many connections each client will make. A value of 0 means each client will loop until told to stop. 0
30
1000
orderA value of 0 means each client will connect to each page in sequential order. A value of 1 means that each client will randomly choose a page for each connection. 0
1
ParseRequestA value of 1 means for each request sent by a virtual client, the URL, POST, and GET argument will be parsed and any special markers will be expanded into dynamic data. See the Request Parsing section below for more information. 0
1
EnableCookieA value of 1 means each client will store and send a single cookie that is set by the web server that is being queried. 0
1
getThis entry identifies a page that you want to request using the GET method. You can have as many of these lines as you need. The leading slash is important. Do not include the protocol or host portion of a URL (i.e. http://www.foobar.com) The entry may optionally be followed by a DataStart/DataEnd pair. /
/home.html
/products/cool/socrates.html
/socrates.txt
sgetThis entry identifies a page that you want to request using the GET method via SSL. You can have as many of these lines as you need. The leading slash is important. Do not include the protocol or host portion of a URL (i.e. http://www.foobar.com) The entry may optionally be followed by a DataStart/DataEnd pair. /
/home.html
/products/cool/socrates.html
/socrates.txt
postThis entry identifies a page that you want to request usong the POST method. You can have as many of these lines as you need. The leading slash is important. Do not include the protocol or host portion of a URL (i.e. http://www.foobar.com) The entry must be followed by a DataStart/DataEnd pair. /
/foo.cgi
/products/cool/doit.morph
/process.pl
spostThis entry identifies a page that you want to request using the POST method via SSL. You can have as many of these lines as you need. The leading slash is important. Do not include the protocol or host portion of a URL (i.e. http://www.foobar.com) The entry must be followed by a DataStart/DataEnd pair. /
/foo.cgi
/products/cool/doit.morph
/process.pl
dataStartThis entry identifies the start of a data section. See the DATA section for a description of how to specify extra data for GET and POST requests. dataStart
name value
dataEnd
dataEndThis entry identifies the end of a data section. See the DATA section for a description of how to specify extra data for GET and POST requests. dataStart
name value
dataEnd
#Any line beginning with a # is ignored #

Open

You must load a configuration file before you can examine a web site. Use the "File | Open" menu option to select the desired configuration file.

Start

When you select the "File | Start" menu option, Socrates will request the all powerful socrates.txt file from the intended server. If this file exists, then Socrates will create the virtual clients and begin asking questions of your web site.

Stop

When you select the "File | Stop" menu option, Socrates will tell all of the virtual clients to stop and die. If any of them are waiting on the server for information, they will continue to live until the server returns some data. You will know that all clients are dead when the "File | Start" menu option becomes available. If you are really in a rush and can not wait on the connections to terminate normally (wedged server...) then just quit and restart Socrates.

Data

You can send search arguments with your GET and SGET requests and extra data with your POST and SPOST requests by specifying the name/value pairs inside of a dataStart/dataEnd section. This data section must immediately follow the request entry that it applies to. The values of the name/value pairs are automatically URL escaped, so that characters like SPACE, +, &, and so on are properly encoded in the request.

For Example:

Get		/test.morph
dataStart
foo		bar
baz		bad
dataEnd
This will generate a GET request that looks like this:
http://www.myserver.com/test.morph?foo=bar&baz=bad
This configuration example:
Post	/test.morph
dataStart
foo		bar
baz		bad
dataEnd
Will send the submit a request to the webserver as if the following HTML had been used:
<FORM METHOD="post" ACTION="test.morph">
	<INPUT NAME="foo" VALUE="bar">
	<INPUT NAME="baz" VALUE="bad">
	<INPUT TYPE="submit">
</FORM>
In this configuration example:
Get     /test.html
Post    /test.morph
dataStart
foo		bar
baz		bad
dataEnd
The GET request for test.html will not send any search arguments. The POST requst for test.morph will send extra data.

Request Parsing

If you need to have each virtual client send a special unique identifier to the web server, you will need to enable the ParseRequest option in the Socrates configration file. The following special tags will be processed:

TagDescriptionExample
~id~This tag will be replaced with the virtual client ID. This is a 0 based integer./foo.cgi?trackid=~id~

/foo.cgi?trackid=0
/foo.cgi?trackid=1
For Example:

Get		/test.morph
dataStart
theid		trackid~id~
dataEnd
This will generate a GET request that looks like this:
http://www.myserver.com/test.morph?theid=trackid0 for the first virtual client
http://www.myserver.com/test.morph?theid=trackid1 for the second virtual client

What Does It Tell Me

The fields 2xx, 3xx, 4xx, 5xx, and Dropped all keep running totals of how many connections of their respective type have occurred.

2xxSuccessful
3xxRedirection
4xxClient Error
5xxServer Error
DroppedNo response after initial connection

The other fields keep some statistics on the overall performance of the server.

ConnectionsHow many connections have been made or attempted
Elapsed TimeHow may seconds has Socrates been querying the server
Connections/SecHow many connections per second is the server providing. This value is calculated based upon the last 100 connections.
Avg. LatencyHow many seconds does it take for the server to send back the first piece of data in response to a request. This is how long you must wait before your browser can begin to render the requested page. This value is a sliding average over the last 100 connections.
Avg. TransferHow many seconds does it take for the server to send the rest of the data. This is how long you must wait for the page to be completely transferred after the initial data has been sent. This value is a sliding average over the last 100 connections.
Total KBytesThe sum total of all the data sent by the server. This value includes the HTTP headers.

All of the statistics reset after Socrates has been stopped.

The graphical display provides a real time display of the status of each virtual client. The dots and lines have the following meaning:

Light green dotThese dots, arranged around the circumference of the circle are the clients.
Blue dotThis dot, located at the hub of the circle is the server.
Red spokeA red line between a client and the server indicates a failed connection (5xx or dropped).
Yellow spokeA yellow line between a client and the server indicates a connection is being created.
Green spokeA green line between a client and the server indicates the client is connected and waiting for data.

Lurk Mode

When configured to LURK, Socrates will will beep if the server fails to respond properly. In this mode, Socrates will NOT ask for a socrates.txt file. To keep Socrates from overloading a site that it is Lurking on, several configuration parameters are limited:

If the server fails to allow a connection or return a valid reponse (codes 200-400) then Socrates will start beeping. Socrates will, however, continue to query the server. If the server returns a valid response, then Socrates will shut-up.

Basic Authentification

If a username or password is provided in the configuration file, Socrates will send the username/password combo using Basic HTTP Authentification with every page request. This includes the allmighty socrates.txt file. This is just a quick hack for now. In the future you will be able to define a username/password combination for each request.

Potential Need For Microsoft Internet Explorer

Socrates uses the same registry entries as Microsoft's Internet Explorer (IE) for things such as proxies or valid Certificate Authorities for SSL. If Socrates is having trouble making reuests against your server, you should load and use IE from the same machine that you run Socrates on. Try to make the same requests from IE that you want Socrates to make. Any configuration changes that you make with IE will be used by Socrates.

Net Etiquette

Socrates has the potential to be used to initiate a denial of service attack on a web site. Using this tool, you could place such a heavy load on a site that no other user could get access, or worse yet, you could actually crash the site.

Being benevolent web beings, we have not given Socrates this power. Before a site can be queried by Socrates, a file named socrates.txt must exist in the root document directory.

Socrates also leaves tell tale tracks. Each request contains this User-Agent header entity: Socrates (Web Site Stress Tool)

Ramblings

This program is "post card" ware. If you use it, send me a post card! Otherwise you will be nagged.

Morph Technologies
1919 Gallows Road, 10th Floor
Vienna, VA   22812
USA

This program is distributed as a service of it's Author Mike Pav. I make no warranties about this software, and it is distributed "as is".

Current versions of Socrates can be found on the Morph Technologies web site at http://www.morphtech.com.

Questions, comments, suggestions, and even bug reports are always welcome. Send them to mpav@morphtech.com.

Socrates was an ancient Greek philosopher that said "The unexamined life is not worth living". He taught by the Socratic method; skillfully posed questions are a better teaching tool than just stating the facts. He believed that through careful introspection, life can be lived to the fullest. We believe the same to be true of the web!

Morph Technologies

Morph Technologies is dedicated to developing tools that help untangle the World Wide Web. Our flagship product is DynaMorph, a server side extension to HTML.

DynaMorph allows people creating Web pages to embed into their HTML documents very powerful programmatic constructs which would otherwise require an external CGI. DynaMorph keeps HTML layout and CGI-type specialization in a single document. This enables users who build interactive web sites to operate within a single paradigm. Unlike other products on the market like Cold-Fusion, WebSiphon, and NetCloak, DynaMorph uses a powerful separation between the constructs of web-site templating which are static and those which are dynamic. This allows DynaMorph to cache and serve dynamic documents very quickly while still providing access to the powerful server-side include structures which greatly eases the site creation process. While the DynaMorph language provides a high level of expressiveness for professional programmers, it also has quite a number of easy to use, pre-built features which will make it immediately useful to non-programmers.

DynaMorph is currently supported on Mac, Windows NT, Windows 95, and Linux. This is great for Web development companies that like to do their graphic and site development work on their Macintoshes (without excluding PC Users), yet have a requirement to deliver their work to clients running on NT or UNIX platforms. With an interactive site built using DynaMorph, developers and designers can literally pick-up their DynaMorph site hosted on a Mac, plop it onto an NT box and....It will just work!

Copyright © 1996-1998 Mike Pav