Thoughts on using Linode as both dev and production server?

I am currently scp'ing my webapp onto my Linode in order to have it up and running. The scp includes all of the git information and the entire workspace I was using which is about 350 MB. I don't want to have to scp every time I make a change considering how slow it is being, so I am considering just using linode to do all of my development as well (installing git etc). Are there any drawbacks in doing this or anything I should be aware of? I do not want to compromise how well my app runs in production. (I tried googling things similar to 'Linode as a production and dev server' but nothing came)

7 Replies

doing dev and production on the same environment creates the risk of accidentally munging your production site when you're working on your dev stuff. This is pretty much the reason why the dev setup is usually separated from the production environment.

consider doing dev stuff locally, then figure out a way to deploy your changes to your Linode when ready. You can also opt to do development on a second Linode, or perhaps use some kind of cool hip container-thang like docker (http://www.docker.io/)

If you are scp'ing entire git repo why aren't you just using git push instead? That's quite a bit more efficient. If you can't do pull/push then you should setup some kind of "build" mechanism to create either a .tgz that you scp or even better a full directory that you rsync over via ssh.

As for production + env on same machine… it's certainly possible to do if you need to save money but you have to be very careful (e.g. doing drop on testing database should always scripted for obvious reasons and you have to make sure all app configuration is going to the proper database) and there are some limitations on the test server (e.g. you don't want to do load testing or smoke tests on a server used for production).

Doing dev work on a production machine can be risky, however if it's just a bunch of php/perl/python/etc. you can easily setup a subdomain to keep your dev site separate from your main site. You'd have to be very careful not to accidentally copy your dev stuff to your main site, and if databases are used you should have separate databases for both.

On a side note, you may want to look in to sshfs, which utilizes ssh to take a directory from one machine and "mount" it on another. Anything saved within the mounted directory will be automatically piped via ssh to the remote machine.

@hullz:

I am currently scp'ing my webapp onto my Linode in order to have it up and running. The scp includes all of the git information and the entire workspace I was using which is about 350 MB. I don't want to have to scp every time I make a change considering how slow it is being, so I am considering just using linode to do all of my development as well (installing git etc). Are there any drawbacks in doing this or anything I should be aware of? I do not want to compromise how well my app runs in production. (I tried googling things similar to 'Linode as a production and dev server' but nothing came)

It's a great idea and testing on the same hardware is the only way to be sure that things really will work right. Use two different Linodes and be aware that they won't behave absolutely identically as they may be on different hardware and they will be under different loads from other customers. If you are testing code not load you don't care about those differences.

If you are scp'ing 350MB you really want to try rsync instead. Rsync is a wonderful tool.

Wait - Do you mean doing test and production on the same machine? That doesn't sound like a good idea.

@sednet:

It's a great idea and testing on the same hardware is the only way to be sure that things really will work right. Use two different Linodes and be aware that they won't behave absolutely identically as they may be on different hardware and they will be under different loads from other customers. If you are testing code not load you don't care about those differences.

If you are scp'ing 350MB you really want to try rsync instead. Rsync is a wonderful tool.

Wait - Do you mean doing test and production on the same machine? That doesn't sound like a good idea. <- yes by dev I also meant testing :-D but okay. edit: for now, I won't be looking into load-testing. After a few months of pre-beta I think then I will look into that. Or load-balancers if need be.

@Piki:

Doing dev work on a production machine can be risky, however if it's just a bunch of php/perl/python/etc. you can easily setup a subdomain to keep your dev site separate from your main site. You'd have to be very careful not to accidentally copy your dev stuff to your main site, and if databases are used you should have separate databases for both.

On a side note, you may want to look in to sshfs, which utilizes ssh to take a directory from one machine and "mount" it on another. Anything saved within the mounted directory will be automatically piped via ssh to the remote machine.

will be using mongodb & nodejs. I will look into sshfs as well as rsync then

@Ox-:

If you are scp'ing entire git repo why aren't you just using git push instead? That's quite a bit more efficient. If you can't do pull/push then you should setup some kind of "build" mechanism to create either a .tgz that you scp or even better a full directory that you rsync over via ssh.

As for production + env on same machine… it's certainly possible to do if you need to save money but you have to be very careful (e.g. doing drop on testing database should always scripted for obvious reasons and you have to make sure all app configuration is going to the proper database) and there are some limitations on the test server (e.g. you don't want to do load testing or smoke tests on a server used for production).

hmm git pull/push won't be sufficient because not all of my files are stored in the git repo. I have a lot of images, and 3D models that I am storing on dropbox rather than git. Hm but you bring up a lot of good points.

The other issue is that my local machine is a Windows machine. It got pretty irritating after some time (lots of tools guides are linux-focused), so I decided to just start setting things up on Linode. I'm using mongoDB nodeJS and it's a webapp. The thing is, it's not quite done yet, but I want to bring some initial users onto it within a few days from now. I want to keep developing and adding features though. I see the problem of trying to develop in the same environment as where production is running because (knowing me especially) it will be easy to muck things up on the production environment. I guess I will think about rsnyc'ing things from my Windows local machine to the Linode server. OR just buy another linode server to do dev on, and rsync between the two environments.

@hullz:

@Piki:

On a side note, you may want to look in to sshfs, which utilizes ssh to take a directory from one machine and "mount" it on another. Anything saved within the mounted directory will be automatically piped via ssh to the remote machine.

will be using mongodb & nodejs. I will look into sshfs as well as rsync then

The other issue is that my local machine is a Windows machine. It got pretty irritating after some time (lots of tools guides are linux-focused), so I decided to just start setting things up on Linode….

I forgot about rsync. There are Windows clients for that, not so sure about sshfs.

One possibility is to use VirtualBox. It works on Windows, Mac, and Linux, and you can use it to setup a virtual Linux installation. It can also share files between your real and virtual machines. It's really easy to use. The hard (but still possible) part is to set it up as a virtual server to access from your real machine – but you can always use it as more a virtual desktop to more easily use, e.g. sshfs, rsync, scp, and various other Linux utilities to "talk" to your Linode.

When I was doing work for Wikkii, I saw people creating what were essentially development wikis on the internet with their wiki Cpanel accounts. It was really stupid. You should never have a development server on the public internet (your own internet is fine, provided that you trust the people on it) and it's odd too. It's not hard to setup a webserver and all the stuff you need with it on your own computer. If you need to, you can set up localhost subdomains, so it will function exactly like the production environment. Plus all the things you need for security will get in the way in a development environment. It's also helpful to be able to upload web apps you're working on when you have questions without worrying about whether you removed the passwords.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct