Horizontal scaling of JSF 2.0 application

前端 未结 3 1307
被撕碎了的回忆
被撕碎了的回忆 2021-02-09 02:03

Given that JavaServer Faces is inherently stateful on the server side, what methods are recommended for horizontally scaling a JSF 2.0 application?

If an application run

相关标签:
3条回答
  • 2021-02-09 02:20

    What about session replication with "buddy" semantics?

    With one buddy total memory is halved (every server needs to hold the session data of two servers), which is a lot better than having to hold data of each and every server out there.

    Buddy replication also reduces bandwidth overhead.

    0 讨论(0)
  • 2021-02-09 02:34

    This can be achieved by configuring your load balancer in sticky session mode.

    More info

    This way all your subsequent requests are sent to the same application server.

    0 讨论(0)
  • 2021-02-09 02:35

    Here's an idea from Jelastic PaaS:

    Pair-up application instances in 2-server clusters, and apply session replication between those 2 instances within one cluster. Then you can add as many 2-instance clusters as you want and load balance requests between clusters, with each session sticking to the cluster it originated from. Within cluster, requests could be load balanced between instances.

    This way there is some degree of fail safety, since if one instance in cluster fails, the other takes over, with same session state. On the other hand, memory impact is not as severe as with full replication.

    In short, it is combination of 1. and 2. from your question. Of course, there can be more than 2 instances in each cluster, if availability is of greater concern.

    Link to Jelastic docs I lifted the idea from: http://jelastic.com/docs/session-replication.

    Disclaimer: I don't actually know how to configure this with JSF2, and have no affiliation with Jelastic. Just liked the idea and thought it might help.

    0 讨论(0)
提交回复
热议问题