0

I'm looking for guides, advice, or samples of how to develop and config a PHP app that support load balancing on AWS with Apache, how to control session between load balanced server.

I've never load balanced servers before. My PHP app will be a web app that can serve hundred of users at the same time, it will use MySQL database.

Thong Vo
  • 809
  • 1
  • 9
  • 21
  • Save session data in a remote location available to all servers, eg on a database server. Redis is a popular choice, but if you already have a remote mysql server set up, and dont want to install additional software on it, then you can use mysql for season storage – Steve Dec 16 '15 at 10:36
  • Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Epodax Dec 16 '15 at 10:50
  • @Epodax Ok, the problem is my team has never use load balanced server before, and now we want to create an PHP app that support it, project not started yet, so I must try to learn new experience with this before going to develop. Can you give me some advices? – Thong Vo Dec 16 '15 at 13:40
  • Your reason doesn't really matter, if it's off-topic it's off-topic, so no, I can't give you some advice. (Mainly because I don't know). – Epodax Dec 16 '15 at 13:41
  • Is Sticky Sessions not an option? – Mark B Dec 16 '15 at 16:24
  • @Steve When we use load balancing the data and transaction is gigantic already, so is that a good idea to put stress into the DB? – Thong Vo Dec 17 '15 at 00:58
  • @mbaird Just give me any solution, I will research and discuss with my team to pick the best appropriate one. – Thong Vo Dec 17 '15 at 00:58
  • @ThongVo in a distributed system, you have no choice but to manage sessions ina central location. If your DB server cannot handle it, then a seperate session server is the solution. A low resource solution like Redis would be a good choice – Steve Dec 17 '15 at 01:27
  • @ThongVo If you aren't constantly adding and removing servers, then just enabling sticky sessions on the load balancer will probably be enough. You'll just need to test it and make sure it works for your application. It keeps sessions tied to the server that created them, so you don't have to do all that stuff Steve is trying to talk you into. – Mark B Dec 17 '15 at 01:33
  • How about using a No-SQL database as a session storage? – Thong Vo Dec 18 '15 at 07:31

0 Answers0