Multiple RMI Connections from single JVM using Weblogic RMI over T3 - java

I'm attempting to use JMeter with some custom samplers to load test a Java application that is normally accessed via Weblogic RMI over T3 from a Swing-based GUI. Intention is to load the application server and measure the response time of particular transactions by simulating many concurrent user connections/interactions (up to ~500).
I have implemented a couple of JMeter samplers that acquire a RMI connection to the server via a JNDI lookup and that works fine. However I've noticed that, even if I acquire two contexts on different threads using different credentials, only one T3 connection is opened.
Is there a way to effectively create multiple independent connections to the app server from within one JVM, or will I be forced to run one user per JVM?
App is running in WLS 11g, currently on Hotspot 32bit but will be moving to JRockit 64bit.
Thanks.

You are running up against RMI connection pooling. There are ways to turn it down, see the RMI Home Page and the Properties pages linked from them, but it's still an unrealistic test for other reasons such as port exhaustion on the client host. You should really look at using as many client hosts as possible with as many separate JVMs as possible.

Related

All web containers occupied by one app that depends on 2nd app

We have an application on our WebSphere Application Server that calls a web service of a second application which is deployed on the same app server.
There are 100 available web containers (threads).
At times when there are many active users, application 1 allocates all available web container threads. When application 1 tries to call the web service (application 2) there are no free threads, so application 1 never finishes and therefore the whole system hangs.
How can I solve this? For example, is it possible to restrict the web container thread count per application? For example, I would only permit application 1 to use 50% of available threads.
A solution would be to add some code to application 1 that watches the count of requests being processed simultaneously. But I'd try to avoid that if possible, because I think this is very error prone. Earlier, we used the synchronized keyword. But that only allows 1 request at a time which caused even bigger problems.
It could be possible by defining separate transport chain and thread pool.
I dont have web console before me, so steps in rough order:
create separate thread pool for your soap service app
create separate web transport chain on new port e.g. 9045
associate that thread pool with transport chain
create new virtual host, with host alias *:9045
map your soap-service app to that port
If you will access app via 9045 port it will use your own separate thread pool for that.
Concerns:
if it is only local access (from one app to the other) then you just access it via localhost:9045 and you are good to go
if your soap service needs to be accessible ALSO from outside e.g. via plugin with the default https port (443), you would need to create different DNS hostname for that so it can be associadet with you soap sercvice app eg. soap-service.domain.com (and then you use that domain in the host alias instead of *. In that case plugin should use that 9045 port for transport also, but I dont have env at hand to verify that.
I hope I didnt complicate it too much. ;-)

How can I have multiple localhosts in a machine?

Suppose, I want to test two server applications and one client application such that if one of the servers fail, the client can still be connected to the second server without the interruption of a task.
In order to do that, I need two localhost addresses so that each server can expose one endpoint to to the incoming clients.
How can I achieve that in a laptop?
Some suggests using Virtual Machines with Internal Networking. But, my PC can't take the memory load of two virtual machines running simultaneously.
Any suggestion?
Run the servers on different ports.
While using servers like Tomcat, Jboss, etc. You can make separate instances and bind separate ports using configuration (mostly xml ) files.

What are good ways of monitoring server status?

I have a central load balancing server and several application servers running on Apache Tomcat. The load balancing server receives request and forwards them to the application servers in round robin fashion. If one these application servers goes down, the load balancing server should stop forwarding requests to it.
My current solution for this is to ping the application servers every few minutes and if I don't receive a response, remove them from a list of available servers. Is there a better way to monitor the status of these servers? Should I ping more often or should the application servers constantly inform the load balancing server?
Execute a null transaction on it regularly. Pinging really isn't enough, it only exercises the TCP/IP stack, and I have seen operating systems in states where TCP/IP was up but no applications and not even part of the OS stack itself. Executing a transaction exercises everything. Include the database in the null transaction.
First ensure your server isn DDOS attrack protected , if the depends on you application connection avg time edit keep alive time
Then you should study about precock mpm , i think it will give you best solution

Simultaneous access to Database in Web application

How can I know the average or exact number of users accessing database simultaneously in my Java EE web enterprise application? I would like to see if the "Connection pool setting" I set in the Glassfish application server is suitable for my web application or not. I need to correctly set the maximun number of connection in Connection Pool setting in Application Server. Recently, my application ran out of connections and threw exceptions when the client request for DB expires.
There are multiple ways.
One and easiest would be take help from your DBAs - they can tell you exactly how many connections are active from your webserver or the user id for connection pool at a given time.
If you want some excitement, you will have to JMX management extensions provided by glassfish. Listing 6 on this page - gives an example as to how to write a JMS based snippet to monitor a connection pool.
Finally, you must make sure that all connections are closed explicitly by a connection.close(); type of call in your application. In some cases, you need to close ResultSet as well.
Next is throttling your http thread pool to avoid too many concurrent access if your db connections are taking longer to close.

Tomcat creating new thread for same session

I have a webapp that uses Stripes and the Apache Shiro library for security.
On my local Windows Tomcat 6.0.33 installation everything works fine. However, when I run the app on Tomcat 6.0.16 on Linux at my host DailyRazor, I can see that periodically Tomcat is spawning a new thread for the same user/session, and so the user is losing their credentials and being asked to login again.
I also noticed this on my dev box when running under Jetty.
I don't think it's an inactivity timeout issue as the hits I am giving the webapp are sequential, is there something in the Tomcat config that may be different, apart from the different minor versions?
Alternatively, is there an easy way to debug the session info (as it's not appearing in my urls)?
Just to make it clearer than if it was in a comment: Each HTTP request will be handled by an arbitrary thread. Tomcat (and other app servers) use a pool of threads, pick a thread from the pool, execute the request, and give back the thread to the pool.
The HTTP session is completely orthogonal to the threading: several requests from the same session may be handled by different threads. A thread executes requests from several sessions. There are typically much more parallel sessions than threads in the pool. And finally, you may very well have two threads executing two requests for the same session. That implies that the objects stored in the session should be thread-safe, or that a synchronization mechanisme should be used to access non-thread-safe objects stored in the session.
Moreover, multiple frames or tabs of a given browser share the same HTTP session. You'll have a different session if you start a different browser (Chrome in addition to Firefox, for example), or if you use a browser on another machine.

Categories