Sunday, August 16, 2009

Load Testing - Simulating Batch Jobs

Many of the production systems have the batch jobs running in the background either scheduled or unscheduled. This load is critical even though batch jobs run normally in off-peak hours. In the pre-production performance testing it is important to design a scenario simulating the batch job transaction load.

Most of the batch jobs deals with updating database tables or uploading files to the containers where the listening programs picks up to process the requests. The below explained scenario is something related to the same.

Say we have a scenario where there are 10 systems which collects user requests and stores them to get processed at the end of the day. Each system has varying number of requests to be processed at varying pace by the out bound systems/listeners.

To simulate the scenario, let's say each system has a request storage directory(x) with n files per request type and Listener pick-up directory(y).Now based on the production load, the simulator need to upload file1 from x to y, n times in the duration t resulting the production transaction per seconds.

The below code snippets do the same
  • Reads user inputs like duration (d mins), number of times to copy (n), source directory(x),destination directory(y), filename (a) from input file commands.txt
  • Copies file from source x to destination y for n times in duration of d mins
  • Checks for the file consumption at the destination y. If consumed by the listener, then does the copy and increments the success counter. If not, does not copy and also increments failure counter
  • The counters will be logged to successlog.txt and failurelog.txt and gives a final summary report showing the response of the listeners and load behaviour
Code:
  1. Folder Strucure
  2. Windows: LoadInitiator Uploader Commands
  3. Unix: Commands LoadInitiator, Uploader




No comments:

Post a Comment