Scaling

From SocialStrap Wiki
Jump to: navigation, search

How many users can I have?

The performance of the script is dependent on the capabilities of your server. As with any web-based application, you may need to upgrade your server (scale) if your social network attracts a large amount of traffic. It would also depend on the activities of your users, number and type of additional addons and other variables. On most shared-server plans, script should be able to support few thousands of users, while a single dedicated server can usually support upwards of one hundred thousand users however we make no guarantee of performance due to the many variables involved.


Scaling SocialStrap

There are two types of scaling – horizontal and vertical. We say that a website is scalable when it can manage increases in traffic without needing software changes. With SocialStrap your network can grow and scale all the way up.


Vertical scaling

Imagine having a server serving your users. The server has 4GB of RAM, an i5 CPU, and a 1TB HDD. It performs its function well, but to better tolerate a higher influx of traffic, you decide to replace the 4GB of RAM with 16GB, you put in an i7 CPU, and you add a PCIe SSD/HDD Hybrid drive. The server is now much more powerful and can handle a higher load. This is known as vertical scaling, or “scaling up” – you improved the machine to make it more powerful.


Horizontal scaling

On the other side of the spectrum, we have horizontal scaling. In the example above, the upgrade itself will likely cost as much as, if not more than, the starting machine on its own. This is costly, and often doesn’t produce the benefits we need – most of the scaling problems are related to concurrency, and if there aren’t enough cores to perform the logic fast enough, no matter how strong the CPU, the server will grind to a halt and force some visitors to wait.

Horizontal scaling is when you build a cluster of (often weaker) machines linked together to serve the website. In this case, a load balancer is used – a machine or program whose only role is determining to which machine it should send the request it intercepted. The machines in the cluster then automatically divide the workflow among themselves without even being aware of one another, and your site’s traffic capacity increases immeasurably. This is also known as “scaling out”.


Scaling Example

Keep in mind that your actual figures may differ. Installed addons can also impact the overall performance based on their type and quality.


Total Users 5000 10000 100k 300k 500k 1M+
Online Users (concurrent) 30 100 200 500 1000 2000
Server Type shared hosting vps vps vps/dedicated dedicated dedi. / load balancer
Min. Memory / 1GB 2-4GB 8GB 16-32GB 32GB
Image Storage local disk local disk disk/cloud disk/cloud cloud cloud
DB Server / / / 1 dedicated 1 master / 1 slave 1 master / 2 slave
Session Server / / / / / dedicated