sticky-session

Sticky sessions on Kubernetes cluster

霸气de小男生 提交于 2021-01-21 04:04:22
问题 Currently, I'm trying to create a Kubernetes cluster on Google Cloud with two load balancers : one for backend (in Spring boot) and another for frontend (in Angular), where each service (load balancer) communicates with 2 replicas (pods). To achieve that, I created the following ingress: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: sample-ingress spec: rules: - http: paths: - path: /rest/v1/* backend: serviceName: sample-backend servicePort: 8082 - path: /* backend:

Using ID in URL for load balancing with HAProxy

时光怂恿深爱的人放手 提交于 2020-06-01 07:53:44
问题 I know it is possible to make connections sticky based on url a parameter: https://serverfault.com/questions/495049/using-url-parameters-for-load-balancing-with-haproxy?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa Is it also possible to do it based on an ID in the url path? If my url is: /objects/:objectId Can I somehow use that :objectId to make the connection sticky? EDIT I was able to load balance making the request sticky on the url path using the configuration

Set jvmRoute in spring boot 2.0.0

拜拜、爱过 提交于 2019-12-12 09:52:21
问题 For sticky session i need to set the jvmRoute of the embedded tomcat. Actually only a System.setProperty("jvmRoute", "node1"); is required, but i want to set a via application.properties configurable property. I don't know how and when to set this with @Value annotated property. With @PostConstruct as described here, it does not work (at least not in spring boot 2.0.0.RELEASE) The only way i found so far is @Component public class TomcatInitializer implements ApplicationListener

How to use Traefik for WebSocket backend

删除回忆录丶 提交于 2019-12-11 01:53:00
问题 I am trying to configure Traefik for a WebSocket app, I just try with a simple WS app on docker: https://hub.docker.com/r/jmalloc/echo-server/ To test it I use Chrome SimpleWebSocketClient, so if I use the IP:Port of the app it works fine. If I add the Traefik DNS it fails, I just try with other WS server and clients and fails too, so it would be something of Traefik. I just try with Traefik versions: -v1.3.0/raclette -v1.2.3/morbier Those are my Traefik rules: [backends.ws-test-backend]

docker-compose scale with sticky sessions

断了今生、忘了曾经 提交于 2019-12-09 13:38:01
问题 I have a webserver that requires websocket connection in production. I deploy it using docker-compose with nginx as proxy. So my compose file look like this: version: '2' services: app: restart: always nginx: restart: always ports: - "80:80" Now if I scale "app" service to multiple instances, docker-compose will perform round robin on each call to the internal dns "app". Is there a way to tell docker-compose load balancer to apply sticky sessions? Another solution - is there a way to solve it

sticky-session vs socket.io-sticky-session node js library ! Which is better?

痞子三分冷 提交于 2019-12-06 09:02:33
问题 I have come across this two sticky-session library for node js https://github.com/indutny/sticky-session https://github.com/wzrdtales/socket-io-sticky-session What is the difference between two, My need is just to achieve socket with node clusters, and also in future if i want to add Ngnx Server. In Socket.io Documentation they have mentioned about the former one, But this link Socket.io 'Handshake' failing with cluster and sticky-session says that second one is better ! 回答1: Recently, I

Set jvmRoute in spring boot 2.0.0

若如初见. 提交于 2019-12-06 02:50:01
For sticky session i need to set the jvmRoute of the embedded tomcat. Actually only a System.setProperty("jvmRoute", "node1"); is required, but i want to set a via application.properties configurable property. I don't know how and when to set this with @Value annotated property. With @PostConstruct as described here , it does not work (at least not in spring boot 2.0.0.RELEASE) The only way i found so far is @Component public class TomcatInitializer implements ApplicationListener<ServletWebServerInitializedEvent> { @Value("${tomcat.jvmroute}") private String jvmRoute; @Override public void

Scaling with sticky sessions and websockets

爷,独闯天下 提交于 2019-12-04 11:58:17
问题 Initially we have two AWS EC2 instances with node.js running behind a load balancer with sticky sessions. As the load increases more instances are added. But we are facing problems with this approach. As out application is mainly for workshops, the load usually increases within a short period of time (workshop start) and every workshop participant has a sticky session with the first two instances and the new ones have almost none. Because of this the performance stays bad. First thought was:

Apache load balance tomcat websocket

筅森魡賤 提交于 2019-12-03 21:38:11
问题 I am currently developing a websocket application, which is deployed on a Tomcat server. Because of the huge number of users I would like to distribute the workload to multiple Tomcat instances. I decided to use Apache for load balancing. Now I have a problem with the implementation of Apache load balancing and sticky session for websockets requests. This is my Apache configuration: ProxyRequests off SSLProxyEngine on RewriteEngine On <Proxy balancer://http-localhost/> BalancerMember https:/

docker-compose scale with sticky sessions

若如初见. 提交于 2019-12-03 16:14:11
I have a webserver that requires websocket connection in production. I deploy it using docker-compose with nginx as proxy. So my compose file look like this: version: '2' services: app: restart: always nginx: restart: always ports: - "80:80" Now if I scale "app" service to multiple instances, docker-compose will perform round robin on each call to the internal dns "app". Is there a way to tell docker-compose load balancer to apply sticky sessions? Another solution - is there a way to solve it using nginx? Possible solution that I don't like: multiple definitions of app version: '2' services: