• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

I *want* multiple sessions from multiple clients logged in from one machine

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've searched in this forum to see if anyone has worked through something like this before. I see a lot of people working on ways to prevent multiple simuultaneous accesses by a single client, but that is just what I want to create.

I want to use a multi threaded client to simulate load on a web app. The application stores some persistent data in the session. Each thread will request different information to model real world behavior more closely.

The problem is that the app server sees each thread as the same client (via cookies) coming from the same process on the same machine and subsequently lets them step all over one another's session-stored data.

I need to fix this on the client side. The purpose is testing the web app we will deploy, not changing the app to something we can more easily test. The real world clients are locked down and will use cookies, so URL rewriting is testing something besides what we will deploy.

I know I can use separate JVMs instead of threads, but then I need more hardware to simulate the same load. I prefer threading if I can find such a solution.

TIA,

Joe
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're writing the client, you can set whatever you want for the headers.
Just don't pass the JSESSIONID header and the server will treat each request as a new session.
 
Joe Gilvary
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
Just don't pass the JSESSIONID header and the server will treat each request as a new session.

Thanks, Ben.

I didn't give you enough information. I don't want every request to be a new session. I want every thread to have an individual session for its use over several requests. Each thread should pull data from the backend to the client, possibly modify it, and send it back through the web app to the persistent store. To look more like the real world, each thread should access different records. Currently they step on one another's requests because they're all in a single session.

Thanks,

Joe
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have each thread hit the app once to get a JSESSIONID.
Then set the header with that value for all subsequent hits by that thread.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds to me like you need the HttpClient package from the Apache Jakarta commons project.
I have used this to simulate large numbers of "clients" with separate sessions from a single machine.
Bill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic