Friday, January 29, 2010

Eclipse VM Args

Multiple VM args can be entered to eclipse by separating them with a space. See the picture below :




2) Issue : Eclipse doesnot allow spaces in vm arguments.

You can force eclipse to take a space by wrapping the value of your argument in double quotes.

-Dpropsfile="H:/user data/eclipse/workspace/wires/etc/dev.config.props"

Cheers,
Sonu

Friday, January 15, 2010

Perl in eclipse

Perl Eclipse Tutorials

PDF download of the tutorial above :





Friday, January 8, 2010

Perl ternary operator

I was trying to use an if else stmt in perl inside a join. And it was throwing compilation errors. In this case you can use a ternary operator to serve as if else :

ex :

($Bond{$_}{CFAC} ==-1 ?”N/A” : $Bond{$_}{CFAC})

sybase convert float to char

Sybase function to convert float to char
convert(char(10),isnull(convert(char(18), pi.factor),'N/A')) as factor

Sunday, August 30, 2009

Clustering

Horizontal Clustering

Horizontal clustering. A horizontally clustered environment contains multiple physical machines (nodes); see Horizontally clustered environments for more information.

A horizontally clustered environment contains multiple physical machines (nodes), as illustrated in the previous section (Architectural overview of a clustered environment) The cluster-enabled application is deployed to each node and is available for requests. An IP-Sprayer (load balancer (IP Sprayer) provides workload management by distributing requests to the various nodes. A horizontal cluster environment is used for high availability of the management server. In a cluster environment where there is only one active management server, the number of supported management agents should not exceed the number of supported management agents in a single server environment because the management server cannot handle the load.

Advantages :
Provides hardware failover.
Provides all the advantages of a vertical cluster .
Scales.
Can be used in conjunction with vertical clusters.

Disadvantages :
Additional machines require more installation and maintenance.


Vertically clustered environments


Vertical Clustering


Vertical clustering.

A vertically clustered environment contains multiple application server instances hosted on the same physical machine (node). The HTTP server plug-in distributes requests to the various web server instances for processing. A vertical cluster is configured so only one server instance is active at a given time.

Advantages :

Provides process failover.
Increases efficiency with multiple Java(TM) Virtual Machines .
Provides load balancing through workload management.

Disadvantages


Offers minimal scalability.
Does not provide hardware-level failover.


The following shows an example of a vertically clustered environment:



Horizontal and Vertical clusters can be worked in combination

Load Balancing - HTTPS Requests

It is difficult to load balance and maintain session information of requests that come in over HTTPS, as they're encrypted. The hardware load balancer cannot redirect requests based on the information in the header, cookies, or URL readings. There are two options to solve this problem:

1) Web server proxies
2) Hardware SSL decoders.

Web server proxy that sits in front of a cluster of Web servers takes all requests and decrypts them. Then it redirects them to the appropriate node, based on header information in the header, cookies, and URL readings.

Web server proxy that sits in front of a cluster of Web servers takes all requests and decrypts them. Then it redirects them to the appropriate node, based on header information in the header, cookies, and URL readings.




Hardware SSL Decoder
Finally, we should mention that there are hardware devices capable of decoding SSL requests. A complete description of them is beyond the scope of this article, but briefly, they sit in front of the hardware load balancer, allowing it to decrypt information in cookies, headers and URLs.

Load Balancing

Hardware Load Balancers

Hardware load balancers solve many of the problems faced by the round robin software solution through virtual IP addresses. The load balancer shows a single (virtual) IP address to the outside world, which maps to the addresses of each machine in the cluster. So, in a way, the load balancer exposes the IP address of the entire cluster to the world.

When a request comes to the load balancer, it rewrites the request's header to point to other machines in the cluster. If a machine is removed from the cluster, the request doesn't run the risk of hitting a dead server, since all of the machines in the cluster appear to have the same IP address. This address remains the same even if a node in the cluster is down. Moreover, cached DNS entries around the Internet aren't a problem. When a response is returned, the client sees it coming from the hardware load balancer machine. In other words, the client is dealing with a single machine, the hardware load balancer.




Advantages :


High Availability Through Failover. Failover happens when one node in a cluster cannot process a request and redirects it to another. There are two types of failover:

1) Request Level Failover. When one node in a cluster cannot process a request (often because it's down), it passes it along to another node.
Transparent Session Failover. When an invocation fails, it's transparently routed to another node in the cluster to complete the execution.

2) Metrics. Since all requests to a Web application must pass through the load-balancing system, the system can determine the number of active sessions, the number of active sessions connected in any instance, response times, peak load times, the number of sessions during peak load, the number of sessions during minimum load, and more. All this audit information is used to fine tune the entire system for optimal performance


Disadvantages :


The drawbacks to the hardware route are the costs, the complexity of setting up, and the vulnerability to a single point of failure. Since all requests pass through a single hardware load balancer, the failure of that piece of hardware sinks the entire site.