Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by
Hi everyone,

I searched this site for an answer and wasn't able to find anything. Currently looking at setting up a Q2A instance and I'm wondering how easily can it scale up? Likely looking at setting this up in AWS with EC2 for load balancing and want to be able to have multiple front-end servers.

I've been debugging through the code and it seems like it might be possible, but I'm wondering if anyone has had any success before?

How many users per day are you expecting to warrant load balancing?

1 Answer

+3 votes
edited by

Before I dive into this: loadbalanced setups add quite a bit of complexity to the system. Not only becomes debugging issues more complex (because more components and more network traffic is involved), but you also have an increased chance for failure of one of the components (meaning increased maintenance efforts). Hence you should evaluate thoroughly if the increased performance/reliability really outweighs the increased complexity. If you don't have so many concurrent users to justify a loadbalanced system I would recommend against it.

With that said, Question2Answer basically consists of 2 parts:

  • web frontend
  • database

For a load-balanced system you need a setup like this:

A database backend, one or more web frontends, and a pair of loadbalancers to distribute incoming traffic to the web frontends. Round robin DNS won't suffice AFAICS, because you want sticky sessions (i.e. client traffic always going to the same web frontend, at least as long as their login session lasts).

Create the database on the DB server, then install Q2A on all web frontends. In qa-config.php point the application to the remote(!) database and set the parameter QA_OPTIMIZE_DISTANT_DB to "true." You may also want to enable persistent connections to the database (parameter QA_PERSISTENT_CONN_DB in the same file).

I recommend using a configuration management tool to ensure that all of your web frontend nodes are automatically configured the same way, so you can easily spin up more frontend nodes if required.

The setup becomes even more complex if you want a HA database configuration (to avoid the database becoming a single point of failure).