The http.exe program is the main program to interact directly with browsers. It is responsible for the following
- Opening one or more network TCP sockets for client communication
- Accepting network connections from browsers and specialised programs
- Processing the HTTP headers and converting requests to QueryExchange requests
- Directly handling the URLs
- /debug/http (if enabled)
- /geni & /map (non complex requests only)
- Rudimentary security checks.
Startup
During startup, this program creates the file "CrashStartup http.Txt". This name does not mean it crashed, rather it encountered unexpected problems. The name CrashStartup was chosen to be very obvious. You may read the contents of this file. If the startup has no problems, this file will be removed.
If you start http.exe when "CrashStartup http.txt" already exists, it internally switches to a more verbose logging mode and writes more detail of startup progress
Once the startup has created a Query Exchange Billboard, problems are typically logged to both this log file and the Query Exchange error logs
You should always be able to start http.exe and connect to the port(s). You can even run this program as the only program and not start Gds generally.
You may run multiple copies of this program and they will attempt various round robin and load sharing options, but generally on Windows one program will take all the network traffic
Example CrashStartup Http.Txt fileStatus,Version: May 15 2015 07:44:06 Status,Using verbose logging mode Status,Preparing system defaults Status,Calling start handler Status,Open Shared Memory Status,Use Shared Memory Status,Creating Billboard Status,Publishing billboard Status,Reading gds.ctl Error,Unrecognised ctl line: alias www.mypublicaddress.org Status,Ctl read Status,Starting interface Port 8310 Status,Starting interface Port 9003 Status,Listeners started: 2 Status,Listener thread waiting to bind port 8310 Status,Listener thread waiting to bind port 9003 Status,Listener thread has bind to port 8310 Status,Listener thread has bind to port 9003
Support
If you terminate this process all HTTP network connections may be instantly broken and errors returned to client browsers. As this program essentially acts as a network protocol converter there should be no need to terminate this program without stopping all of Gds.
Stopping this program does not guarantee network connections will be dropped. http.exe uses high reliability techniques and network connections can survive process termination.
Configuring for High Load
Create multiple http processes to handle the network connections. Each http process is capable of supporting up to 2000 active TCP connections. Having multiple http processes also means that a process failure will not reset all network connections. The drawback with multiple processes is a small increase in cpu and memory load
------------------------------------- ; Http, must have minimum 1 or cannot use the system interactively agent http minimum 3 maximum 20 option(http) sender=3 option(http) maxagent=2 -------------------------------------
If multiple http processes are running, then you may wish to create a control port for each agent, otherwise you will be assigned a random agent process. This is done by allocating a control port and appending a + after the port number. The + flag tells each http agent to increase the port number until it finds the first free one.
For the example below, the first http agent will be listening on port 12345, the second on port 12346
------------------------------------- ; Create a port that can only control Gds interface port=12345+ type=debug,nonormal,nointernet -------------------------------------
Error Codes
A common example will be Socket Write Fail 10054 a.b.c.d which can easily be generated on some browsers by rapidly creating network requests and cancelling them, such as webpages that search between each keystroke.
Technically, the following pseudo sequence has occurred (actual code is more complex, it retries and correctly handles partial buffer transmission):
int sentlen = send(targetsocket, buffer, tosendlen, 0); if (sentlen != tosendlen) Log this error
Technically, the following pseudo sequence has occurred:
HANDLE hRem = accept(listensocket, ...); if (hRem == INVALID_SOCKET) Log this error
Technically, the following pseudo sequence has occurred:
WSADATA wsa; WORD vReq = MAKEWORD(2,0); if (WSAStartup(vReq, &wsa) != 0) Log this error
Technically, the following pseudo sequence has occurred:
hSock = socket(AF_INET, SOCK_STREAM, NULL); if (hSock == INVALID_SOCKET) Log this error
We suggest using
netstat -naoor similar command to identify the process that has the port and correcting that program. Multiple copies of http.exe can share the socket and will not generate this error.
Technically, the following pseudo sequence has occurred:
int r = bind(mysocket, ...); if (r == SOCKET_ERROR) Log this error
Performance Testing
You can test the speed at which http.exe can deliver HTTP requests, the so called echo tests. ( /debug/http/echotest.htm ) With an echo test a client program, typically a browser loops at full speed requesting an echo page from http.exe. Http.exe replies directly to the echo page request.
An echo test will respond with different results depending on server speed, network interface speed, browser type and number of network hops the browser is from the client. The results returned from an echo test are what ONE client can achieve, but http.exe should be able to deliver similar results to multiple clients, depending on what resource is limiting performance. In most echo tests, the browser itself is the limiting resource as it has the greater work to do.