WebServices load balancing using Oracle WebCache? - oracle

I am using JBoss 5.1.0.GA on Red Hat Linux 4. We have only webservices deployed on this application server as .war files (servlets only, no stateful applications present). As a part of our architecture change for improving scalability, we are planning to have multiple JBoss servers running (may or may not be on different IP's and machines) and have a load balancer in front of them to distribute the load. Some of those I know recommended Oracle WebCache for load balancing.
When I started using it, I am able to load balance between the JBoss home page, i.e., requests for viewing the http://loadbalancer-hostname:8080/ brings up the actual JBoss home pages for both the servers in a round robin fashion.
I am trying to simulate external load on the webservices and started using soapUI plugin for NetBeans to do this. When I import the WSDL using the loadbalancer-hostname, it is imported fine, but when I load test it, the requests always go to the same server. My assumption is : When soapUI imported the WSDL, the actual WSDL file would have its <soap:address location="http://actual-server:8080/...?wsdl">. May be this is causing soapUI to always hit the same server.
My question is does Oracle WebCache perform load balancing for webservices as well ?

Yes it can.
A web service URL is like any other URL to the load balancer.
What's most likely happening in your case is the DNS look up is getting cached within the JDK on the consumer side of the web service.
Within Java, once a DNS is looked up, it caches the IP address via the networkaddress.cache.ttl property in %JRE%\lib\security
See this link for more:
http://www.rgagnon.com/javadetails/java-0445.html

Related

Sharing sessions between different servers behind an nginx reverse proxy

Wondering if we can share session data between two servers (running different code) behind an Nginx reverse proxy.
To be precise, we have a legacy app in PHP running on an apache server. We are updating some functionality and hosting only that functionality on a separate server (nginx). Both apps update the same DB.
nginX uses load balancing/ reverse proxy URL rewritting techniques to decide which server to send the client to based on the URL path they use.
So, a person can add items to his virtual basket (held in session) on
the new server application.
He then decides to edit his personal information which is on the other server (Legacy).
Nginx uses it's reverse proxy/load balancing magic to decide which server to send the person to based on where an app is available.
The question is, how can a session created on one app server be available to another app server aswell? is it possible to setup the reverse proxy to store all session data and how. Please point me to the right direction of you can help with google links aswell.
your question has several possible answers. It all depends on the way the application is designed.
A possible scenario would be to keep session information on a database shared among different web heads. In this way the client, once authenticated will retrieve its "session status" regardless which server he is accessing in the final servers cluster backend.
Again, this depends very much on the way the application is/has been designed.
I think there is very little magic you can do on an old legacy application just by configuring the reverse proxy engine.
In the end, sessions are handled by the application server and not the proxy frontend.

Redirect tomcat to maintenance page when my tomcat is down

I just joined a new company and it was told that the sites they have uses tomcat. And, they want to show a custom web page when tomcat is down. currently it will show Error 500. I am the only person in IT team for now and I am pretty new to tomcat and do not have knowledge about tomcat.
Can someone please explain how to setup a custom web page when tomcat is down?I am using only tomcat not apache or load balancer infront of tomcat.
Thanks in advance.
You have to use apache 2 or load balncer in front of tomat.And configure a maintenance page in apache or load balancer.
If you have any problem just post it
This answer may not the correct way but hope it will help to the folks who do not want to use (or not allowed as in my case) apache 2 or load balancer in front of Tomcat server. This solution is for Tomcat servers that contains only one application instance.
I also had a similar problem and they expected a solution without having apache 2 or load balancer in front of tomcat (because it’s a live project and they do not want to change the architecture).
I used two instances of Tomcat server to come up with a solution. The OS is windows and Tomcat server configured as a windows service.
I copied the Tomcat server and create another windows service for this new server. Then I created a dummy project (war file name is same as the original project name) with maintenance html file and deployed it in the new Tomcat server.
Finally created two batch files, one for stop the main Tomcat server and start the maintenance Tomcat server and other one to reverse this process. So once you execute the batch file it will stop the main Tomcat server and bring up the maintenance Tomcat server.
Below is a sample can use in batch file.
#echo off
echo Main Tomcat server will stop
NET STOP "Tomcat9"
echo Maintenance Tomcat server will Start
NET START "Tomcat9-MAINTENANCE"
PS: We can use these batch files in Windows Task schedulers also.

Load Balancing with Tomcat

This may sound a basic question...
But I am new to concept of load balancing and had few questions.
Scenario - I have 3 Tomcat 7 servers which I want to be load balanced.
I read few articles and saw that using Apache HTTP Server one can do this.
There exists a worker.properties file which needs to be defined with the servers you would like to load balance. Now the problem is that this needs to be done before I start the Apache HTTP Server.
Problem - What if I want to add few more Tomcat Servers dynamically without restarting the Apache HTTP Server. Is this possible ?
Regards
Ajax
I spot an interesting article about Tomcat & PAAS: http://www.devx.com/Java/Article/48086
You will probably find what you need in the article. It describes the mechanism to register / unregister a new node in the cluster.
HIH
Apache HTTPD 2.4 supports dynamic reconfiguration of the load balancer. But use the load-balancer proxy module for this, not mod_jk.

Ajax: load data from same server but different port

My main web application is on apache, but sometimes I need to import some pages/data from tomcat server running on same machine. Now Ajax doesn't allow me to request data from tomcat due to "Single Origin Policy".
So how can I implement the import of data from tomcat? One solution could be to use iframes. However someone suggested using relative urls. How do I implement that?
Use the Apache Tomcat Connector (mod_jk). This is used to tell Apache that certain resources will be served by Tomcat (much like mod_php/ mod_perl, etc.). Then your requests go to the same server and you get the added bonus of being able to apply all Apache's stuff to your servlets.

Load test Service layer with LoadRunner thru Spring Remote

I have N-tier application; the presentation layer remote to the service layer through Spring Remote over HTTP. The enterprise uses Mercury LoadRunner for load testing. My question is how can I test the Service Layer by itself using LoadRunner and Spring Remote?? I looked around and could not find documentation on how to do so. Kindly share your experience. Thanks!
It's been a long time since I used this method, so I don't know if it will still work.
Record a web script and look in your proxy settings, you'll see that the web browser is pointing at localhost on port 7777. Set the Spring Remote machine's proxy server to be your VUGen machine on port 7777, it should record without problems, but you'll have to tweak your runtime settings to properly emulate a server.
If this doesn't work then you'll have to record the network traffic with a packet capture library (winpcap, pcap or Wireshark) and write your scripts by hand. This won't be hard if you understand HTTP.

Resources