-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sunday 23 March 2003 11:42 pm, Jay Chandru wrote:
> I am using a socket listener program in HP3000 which listens to a
> particular port for incoming requests.
[...]
> 1) I want to find out the load which this listener program can take at any
> instant of time.
One way to do this is kind of a "brute force" approach: write a program on a
PC that simulates your web server and have it generate as many requests as
possible and time how long it takes the HP to respond. [this has a secondary
benefit in that if you can make the series of "requests" repeatable, say by
seeding the random number generator with a known value, you can use it as a
test suite to ensure the proper operation of your listener -- i.e., that the
correct entries were updated and so on]
> 3) When simultaneous requests are made on the data buffer, how is each
> request independancy maintained from each other.
> e.g. I have a request A from the web services, made on the socket. The
> listener program processes this request and spawns a child program and this
> child program processes the request and passes the data back to the request
> A through the port.(is this true?)
>
> NOw if at the same time, i have request B also from the web service, how is
> the data returned by the child program differentiated for requests A and B.
the key to this is the phrase "spawns a new process" -- each process has data
areas that are independant of others. This is also how a web server works,
otherwise you would get random responses to your requests (when you request a
web page that contains two or more graphical elements, your browser turns
around and makes new requests in rapid succession, "at the same time" for all
intents and purposes -- since the "listener" portion of the web server passes
each request to a child process, each child maintains their own
connection...)
> Will a situation arise where i am looking for the response for request A in
> the socket port and what i get is a response for the request B which was
> also made at a similar time.
The other "Aha!" realization to this is based on the fact that there are two
ends to a socket connection, and each "end" consists of an IP address AND a
port number. The "server side" IP address and port number obviously can't
change, and the "client side" IP address never changes, but the client PORT
number can and does. In other words, connection "A" might look like this:
SERVER CLIENT
IP PORT IP PORT
1.2.3.4 80 <--> 11.22.33.44 12345
but connection "B" would look like:
1.2.3.4 80 <--> 11.22.33.44 54321
Even though this is the same "port" on the server talking to the same client,
the "other end" of the connection is a different port, so each conversation
is kept seperate.
- --
Yet another Blog: http://osnut.homelinux.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: http://osnut.homelinux.net/TomEmerson.asc
iD8DBQE+f2MSV/YHUqq2SwsRAuM3AJ9E+IgzO0Dt98UbaZm5+fBJ6hLCdwCghzcI
l9n8E4OIf/GQnNRIQjfrktk=
=hStR
-----END PGP SIGNATURE-----
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|