Project #5
(Choosing a Server Solution)
(Due 11 April 2007)
The CIO for your company needs to decide which of two proposals for server solutions to accept to provide for the company's credit card transactions, now and in the future. As you know, the company is a clearinghouse for credit card transactions and needs to process/validate many transactions each second and the number is expected to grow. Consequently, it is important for the CIO to find a robust server solution.
Two sets of simulated data have been provided to test each server solution; both sets are in files. One file, current.dat, contains about ten minutes of transactions; in it, transactions arrive about every 6 milliseconds. The other file, future.dat, also contains about ten minutes of transactions but with transactions arriving about every 3 milliseconds. Both data sets have their first transaction time stamped just after 14:20 (2:20 pm) on 12 November 2006. Both data files are in binary, Big-Endian form with each transaction consisting of
Credit card number a long
value (64-bit integer)
Purchase amount
a float value
Date
8 bytes of ASCII codes in the form mm/dd/yy
Hour
a byte (hour of the transaction)
Minute
a byte (minute of the transaction)
Millisecond
an int (No. of milliseconds into the minute)
All transactions have a unique time stamp indicating their arrival at the clearinghouse for service. You can find both data sets on the I: drive in I:\jlwolfe\310\s07
You are to write two programs that simulate the way the two proposed server solutions will handle these transactions. Each program needs a simulator to control the action. The simulator contains a clock that starts at 14:20 and increments each millisecond.
In one server solution, there is a
single server which takes exactly 2 ms to process a transaction.
That is, once a transaction is given to the server, the server will finish
the operation in exactly 2 ms. In the other solution, there are 10
servers, each of which takes exactly 7 ms to process a transaction.
To do load leveling with the 10-server solution, the last digit of the
credit card number will be used to choose which server will handle
a particular transaction. Naturally, the single server solution has
a single queue for waiting and the 10-server solution has ten queues, one
for each server.
The CIO requires you to produce two critical statistics about each server solution.
You will need to execute each program twice to provide the required information, once with the current.dat file and once with the future.dat file. So, it is probably best to prompt for the file name. All output should go to the console. You should expect these executions to take a little time; both data sets contain very many transactions.
Hand in a printout of your well documented programs. For those classes that are common to both programs, just print them once and note at the top that they are common to the two programs. Also hand in a printout of the captured console output for the program executions. Make a p5 folder under the folder named after you on the P: drive and put in it the .java files for the two programs. Do NOT put the data files in this folder.
Extra Credit: Determine the
fewest servers with 7 ms service time which can satisfy the CIO's criteria
of an acceptable solution for the future data. Show a simulation
report that supports your conclusion.
To give you an idea of what sort of report to generate for the CIO. Here is what my program generated for current.dat on the single-server solution.
Simulation ends after 599152 milliseconds
100012 transactions handled
Maximum queue length: 5
Average service time: 2.417 milliseconds