0

I currently have my web app on a single cloud server. Been doing this for a few months now and I have EVERYTHING on this instance (app, cron scripts, mysql, svn, dev environment, etc).

The site is getting bigger now and I'm going to open up a new server instance. What is the best way to utilize this? I have a few options:

  1. Move my development environment over to the new instance along with production cron scripts (the scripts will do operations on the database). The production app and the database itself would still stay in the old server. This option will help minimize any accidental crashes to the production server if I want to do anything on the development server. But it won't be a pure production/development separation because I will still be running cron scripts and maybe thinking of hosting some static assets on the new instance (trying to utilize the most out of this setup).

  2. Move database over to the new instance. This seems like a standard option from the research I've done. But a few questions come to mind: What should be done about the dev/prod separation (do I even need to separate the two)? Static assets--keep in app server or the db server?

I can only afford the total of two servers for now. I would love to get 3, but this is what I have to work with in the meantime.

Thanks for your feedback!

1 Answer 1

0

I doubt my response is 'standard', but another opinion might not hurt.

I would suggest using the second instance to try and attain high-availability. Use HAProxy to load balance between the two servers, and have a distributed filesystem (Gluster) for replicating files between the instances. Have each server monitor the other (e.g. Corosync/Heartbeat/Keepalived), and if one goes down, have the other take over, and launch a new instance. If you have been getting along so far with a single instance, it seems a waste to simply move the databases to one server, as it will probably not be fully utilized.

Essentially, my suggestion is full redundancy - that will split the load between the two servers. You could set the weights such that the 'primary' machine handles more web requests, and the 'secondary' machine handles more database requests, or just leave them equal.

I think the end result of this would be more beneficial than just offloading one aspect of the processing to another server, disproportionately using your servers, and having multiple points of failure.

As for the dev environment, I might suggest that is trickier. A dev environment on a production machine could potentially go wrong. (On the other hand, just keeping an SVN repository on it might not be as risky, if it is well secured).

4
  • What about just using the new server as a backup and dev environment? If I need more resources I can just scale up on the 1st server. This could make room for more flexibility in the future. Jul 12, 2011 at 5:24
  • If that 'backup' can function as a failover then I'd say go for it - otherwise, it seems like a bit of a waste. (Of course companies have dedicated backup servers, but '2' is the limitation here.) If your 'site is getting bigger', removing the backups and dev may not offer a lot in terms of performance/scalability (unless your dev is very processor/memory intensive - but I expect a lot is done on a workstation, although separation is always good). A failover solution would help minimize 'accidental crashes' - even if you took down one server, the other should seamlessly take over the load.
    – cyberx86
    Jul 12, 2011 at 6:12
  • i would need to setup a load balancer for that sort of stuff, right? and that means a 3rd server? how does one implement a 2-server failover process? Jul 12, 2011 at 7:12
  • You can run a load balancer (e.g. HAProxy) on both of the servers, such that if the first server fails, the second one takes over - you don't need a 3rd server. Most articles online do have the load balancers separate, but the theory applies just fine to combining them with the rest of the server.
    – cyberx86
    Jul 12, 2011 at 16:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .