3

With a hardware LoadBalancer, you can configure sticky sessions which will make sure the same session will always go to the same server.

But will this work with webservices also (rather than webservers)?

i.e. I have WebServices hosted behind a Load Balancer.

Will Webservice calls coming from different native clients (not browser clients) always go to the same webservice server?

These are very old style Webservices - uses RPC/Encoding - the native client program uses Axis 1.4 for the client stubs.

user93353
  • 13,733
  • 8
  • 60
  • 122

3 Answers3

1

Webservice calls coming from different native clients (not browser clients) always go to the same webservice server should be possible.

To maintain the session stickiness, mostly load balance inject the server identifier in cookie while responding back to the client(kindly note cookie is not a browser feature it is HTTP feature defined by this specification) and should be supported by the HTTP client which is used by Axis 1.4 underneath).

I suggest you to to analyze how your load balance works and based on that you may have to change your needs to change your clients. If your load-balance uses the cookie based approach, this answer you may found useful.

Hope this helps.

Community
  • 1
  • 1
skadya
  • 4,330
  • 19
  • 27
0

If you can keep your application stateless,make it it's good in both performance and scalability.

Benefits of stateless :

  • Scalability. You can have as many servers as we want without having to share a user session. Each of them can process request (e.g. load balancing via round robin).

  • Saves server resources. We do not need to allocate memory on the server side (again - scalability).

  • No need to recover after a server restart.

Session stickiness can be tricky to get right. For example, if your web servers are running on multi-core machines, and you have several processes handling web traffic, you'll need a way to be sticky to both a specific machine and a single process on that machine. So make sure your system degrades well in cases where stickiness doesn't work correctly.

Good discussion you can find here : Sticky and NON-Sticky sessions

Sticky session pro and cons : Pros and Cons of Sticky Session / Session Affinity load blancing strategy?

Now come to your question :

Will Webservice calls coming from different native clients (not browser clients) always go to the same webservice server?

Yes in sticky session .

These are very old style Webservices - uses RPC/Encoding - the native client program uses Axis 1.4 for the client stubs.

Session configuration you need load balancer/server and it can handle any old or new type of applications

this work with webservices also (rather than webservers)?

No its configuration you need to make on server level.

vaquar khan
  • 10,864
  • 5
  • 72
  • 96
  • This doesn't answer my question at all. – user93353 Oct 09 '17 at 15:28
  • Will it work for both webserver-browser client kind of programs and also for native client-webservice kind of programs? – user93353 Oct 09 '17 at 15:37
  • `Session configuration you need load balancer` - what does that mean? – user93353 Oct 09 '17 at 15:37
  • You need load balancer to configure your routing and in web service code level you can not configure sticky vs round robin – vaquar khan Oct 09 '17 at 15:38
  • As mentioned, there is a load balancer and sticky sessions are configured in it. My question is that how does the load balancer know the session of webservice calls? I can understand load balancer figuring out sessions of webserver calls, but how does it figure out sessions in webservice calls? – user93353 Oct 10 '17 at 03:10
0

It will work as long as your native client correctly manage the session, ie. set the correct http header for each request.

Generally sticky session is managed by the load balancer by modifying the session cookie to add the server identity.

HA-proxy example

There must be a dedicated documentation for your load balancer.

Gab
  • 7,869
  • 4
  • 37
  • 68
  • What session cookie? As specified in the question, I am not talking about a website balanced by a load balancer - it's a webservice. The link you gave does not talk about webservices at all – user93353 Oct 12 '17 at 23:05
  • Set the session header. Web services are using the same channel (http) as other requests. the session is usually managed using a cookie by the browser, in your case you might have to set the header yourself if your client (ie. axis) does not handle it. – Gab Oct 13 '17 at 15:23