How should I approach instancing with DreamCompute?

vps
dreamcompute
software development

#1

After discovering I didn’t have root access to my Dreamhost VPS and subsequently finding out I won’t be able to use some of the middleware/software I need, I’ve decided it’s time - I’m going to take the training wheels off. It’s time for DreamCompute.

I’ve been scouring the web for tutorials and articles on how to properly setup my flavor of code (NodeJS) with PM2 and Nginx. I feel like I have enough material to get started. However, the question is, how should I go about using the cloud computing instancing in particular?

I have several clients and wish to continue using Node going forward for most projects. I only get a maximum of 32 instances (virtual machines). I was wondering if it’s best to use 1 for Nginx and another (larger) instance for multiple projects? Should I use an instance of each project? PM2 allows me to setup redundancy to help scale, but I think(?) it’s better to use nginx and multiple instances instead? Maybe I should just have one really big instance to run everything? Each instance costs so much money per hour of activity. I’d like to be economical but also maintain good performance.

I suppose it depends on the situation and I lack the experience to make an informed decision to go forward with. Who else here has used DreamCompute? How have you set up your instancing?


#2

I’ve used DreamCompute for some time, but I’ve never used PM2, and that seems like the better community to tap for knowledge about scaling and hosting.

As for “cloud” computing, DreamCompute works just like any other service, and the underlying hardware for a given service can sometimes change the performance for a particular use case. You ought to search for PM2 or Node users on DreamCompute, see if they have any feedback. :slight_smile:


#3

Thanks Maiki. PM2 notwithstanding, how have you made your judgement calls for instancing projects?


#4

Well, the stuff I’d use this kind of cloud computing for, I don’t think I would ever be able to personally handle 32 instances. I host WordPress sites, but I use various managed hosting providers for those (including DreamPress), and for other things, like GitLab, jabber, CI runners, Discourse, anything that requires a distinct file system, I just spin up what I need.

Also, I figured if I ran out of slots I could just contact support and have them up my number, or create a subsequent account for 32 more. :slight_smile:


#5

That’s helpful! I don’t plan on hosting basic stuff on DreamCompute - just my NodeJS projects primarily for performance and versatility. I definitely see how choosing how many, or how large instances should be for a given project can be tricky to answer to.

One project I have in particular needs image processing. I expect traffic to be trivial in the meantime…but when/if the project takes off, load will be a concern.

I guess I’ll start small and adapt as I go.


#6

You can use OpenStack tools to provision instances as needed. I’d build to that pipeline, so regardless of where you are hosting your VPN, it can just scale out to however much CPU or RAM it needs. DreamCompute is a lot more interesting than marketed, so poke around in the docs and you’ll find all kinds of scaling tools to programatically interact with the servers.


#7

I’ve struggled with the possibilities of DC since it was first offered for exactly the reason you cited. It seems there is more to it but it’s sort of tossed out there for people who are already familiar with it.

I need a little flavor in my water: It would be great to find a stream of examples of how DC is being used, how fast instances spin up, how to handle latency when some process may need to wait for a new instance, etc. How is it being used with WordPress? MySQL? Web Servers? Java?

I feel like there is the traditional view of computing, with the one and only monolithic server, and then there is this whole new world of distributed computing. And if I could only get a good taste of some applications, I think I can re-wire my brain to make better choices in topology. And that’s directly related to the OP here…


#8

You totally get me. The first thing I said aloud when logging into the DreamCompute control panel was “Buuut why?”

There’s one cool article I found that I’ve read 3 times now and still don’t really understand (because there are 1000 ways to provision, proxy and load balance projects). This seems like the way to take advantage of OpenStack. Check it out here.

However, I’ve managed to setup 1 instance of supersonic (2GB of ram for a max of $12 per month) and install Ubuntu, nginx and PM2 to handle my node tasks. I’m even able to leverage nginx’s gzip and caching settings to help speed up page load on website-centric projects.

So for the sake of example, I’m using mine the like a dedicated server specifically for getting the most out of Node. But what I’m realizing is you can use these instances for just about anything web related.


#9

I get it may sound complicated to use DreamCompute and you’re right: it is :slight_smile:

You may want to try to use the experimental UI on https://cloud.dreamhost.com if you prefer to reduce the amount of options.

There is not the way to do things almost anywhere. All depends on what your needs are, your habits, knowledge, time available, etc. If I understand you correctly, you have multiple customers and for all of them you use similar technology. It may make sense for you to build a massive infrastructure to be shared among all of your customers. This approach has the advantage that you only have to manage one environment but if anything goes wrong with the system, all your customers are affected.

Another approach is to build a set of recipes to create similar environments for each customer, using things like Ansible or Terraform. This requires you to learn more tools but it gives you more flexibility. It’s all about choices, there is no right-wrong.


#10

This is really the heart of the matter - and what I’ve learned over the course of this last week. I have a hankering for the concrete which is entirely my problem. I appreciate this feedback.

This is something I hadn’t considered enough, I think. I currently only have 2 projects on my one instance, but what if it’s 12 and the instance goes down, or gets exploited? I need to be economical in the meantime, but I will consider this possibility going forward as the business grows.


#11

This is where tools like Terraform and Ansible really shine: you can keep in a git repository the basic instructions to create the environment you need. Whether it’s a tiny site all contained in one instance, or a multi-microservices application you can describe all into a few yaml files and create the environments on demand. New customer comes in, you deploy the environment and put them online in a few minutes. There are a few tutorials on how to use Ansible with DreamCompute in the KB: read them to get you started. I’m sure you’ll like that approach.


#12

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.