Question

I'm in the process of setting up a social network and due to the celebrities who will be endorsing it, i'm expecting a legitimate amount of traffic.

Because of this, i'm attempting to build it outright as scalable as possible.

My approach is the following, all of these running on their own virtual machines:

-OS: CentOS6

  • Application (web) server - SocialEngine 4
  • Memcache server
  • Database server
  • CDN - site will be heavy with images, so will need to implement a CDN (maxCDN seems like a legit choice)
  • Monitoring server (zabbix, etc)

My initial approach, in the event that the community grows, is to beef up the virtual machines CPU/RAM. Once that approach no longer suffices, I plan on implementing clustering.

  • Application - separate instance of the code living on each additional application server, all communicating with the single database server
  • Memcache - a cluster with a virtual IP and load balancing implemented to balance traffic
  • Database - a single database node, will have to look into clustering because not too familiar with how to implement for db servers

I've set-up the memcache server already and am aware of how socialengine utilizes it (in the caching section, setting the IP address of the memcache server); In the event that a memcache cluster is needed, i'm assuming a virtual IP address can be used

However, i'm not aware of how to set socialengine to use an external database server. Can someone point me to documentation or describe how to change those parameters whether they are in the the GUI or have to be changed in config files on the server itself?

Any other tips for scalability would be greatly appreciated. I'm hoping that my understanding and approach is legitimate.

Was it helpful?

Solution

Database Configuration

During Installation you specify the database server (see Step 3: Setup MySQL Database). Using localhost tells it to connect to a MySQL database on the same server. If you want to use a different server, then specify the IP address or hostname of the server hosting the database.

You will need to ensure port 3306 is open and that your application server can talk to the DB server on that port.

SocialEngine is a PHP application, and stores database connection info in a config file. This file is locate here:

application/settings/database.php

You can edit that file and change the database connection string even after installation.

Scaling Considerations

For scaling, I'd recommend that you look into the Amazon Web Services platform. There are other cloud platforms, but that's the one I'm most familiar with, so I'll give you some recommendations on what to look into on AWS.

Load Balancing: AWS Elastic Load Balancing (ELB) allows you to split web traffic between multiple servers.

Auto Scaling: With this you can have new servers started and added to your pool based on monitoring events (eg. CPU usage spikes, network traffic spikes). And you can have the extra servers shut down when not needed.

Remote Database Service: This is a managed database service with easily implemented clustering.

CloudFront: AWS's CDN

This is a very useful web cast on scaling in AWS:

AWS Webcast - Scaling on AWS for the First 10 Million Users

For monitoring, have a look at New Relic.

Let me know if you need further clarification/recommendations.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top