Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

AWS EC2 and Perl

by Bod (Parson)
on Oct 20, 2021 at 13:00 UTC ( [id://11137796]=perlquestion: print w/replies, xml ) Need Help??

Bod has asked for the wisdom of the Perl Monks concerning the following question:

Many will know that I need to upgrade from the current shared webhosting...it is overdue!

A dedicated server would, of course, be ideal but I'm not sure I can justify the cost - I'm not totally convinced that I can't either! Plus, there is the server admin that I certainly don't have the time for or the skills for. The latter is solvable but not the time issue in the short-term.

So, I thought about an AWS EC2 instance for all our webs services. This seems an ideal solution for a number of reasons:

  1. Once setup, take an image to restore if I mess things up
  2. Whatever version of Perl we want, we can install
  3. For testing, we take an image of production, spin up another EC2 instance and use that for testing/developing thus avoiding having a test setup and potential security holes
  4. No need to guess about the specs we need - AWS automagically scales as needed
  5. If one part of the business grows significantly, its easy to spin up another EC2 instance just for that
  6. Not as much server admin needed as a dedicated server but still some

In some ways this seems too good to be true...
Is this a plan worth looking further into or have a overlooked a flaw somewhere?

We have databases of significant size - the biggest has 138 tables but only takes up 285Mb storage space. Plus we use Perl for everything! The shared hosting runs Apache but I have nothing to do with that other than some simple additions to the webroot .htaccess file.

Replies are listed 'Best First'.
Re: AWS EC2 and Perl
by hippo (Bishop) on Oct 20, 2021 at 14:29 UTC
    No need to guess about the specs we need - AWS automagically scales as needed

    That isn't the whole story (at least with EC2). You can scale your instance as needed but (a) that involves a little downtime and (b) there is nothing automagic about it.

    Also, if you are on a tight budget be aware of the potentially unbounded costs with AWS (bandwidth, CPU bursts, etc.).

    EC2 isn't the worst solution but neither is it an all-round win. There are other hosting providers who might better suit your requirements, especially if you don't have the sysadmin skills to manage a server - AWS will not answer the phone.

    Good luck with whatever you decide. It will give you more freedom than shared hosting which has to be good.


    🦛

      You can scale your instance as needed but (a) that involves a little downtime and (b) there is nothing automagic about it.

      Oh!!!
      I do find the documentation rather unclear...
      Obviously I have misunderstood what I have read.

      I thought it was too good to be true

        The page you have linked to there is a high-level overview of the sorts of things that can be done with AWS to manage web hosting. When it says:

        Websites that need to scale using load balancing, autoscaling, or external databases

        you can surely do that but do not think that a single EC2 instance will give it to you. When they say "load balancing" they mean "use, deploy and pay for an Elastic Load Balancer to sit in front of your instances". When they say "autoscaling" they mean "use, deploy and pay for an Auto Scaling Group which will expand your fleet of EC2 instances behind the load balancer to match demand". You'll be paying handsomely for the external databases too, if you hadn't already guessed. It's a bit of work to set up such an environment but once done it runs pretty well. If you have the volume of traffic where you might need this then it is worth considering but it won't be cheap. Other providers will have similar offerings too, of course.


        🦛

Re: AWS EC2 and Perl
by 1nickt (Canon) on Oct 22, 2021 at 10:07 UTC

    For a good balance I highly recommend Linode. It's extremely affordable, easy to use, and stable, gives you complete freedom on your server, and offers snapshot backups for a few dollars more a month.

    Hope this helps!


    The way forward always starts with a minimal test.
      I’ll second the suggestion of Linode. There is also Digital Ocean, which is basically the same thing and offers competition.

      The downside is that you do need to learn some system administration, to start your own database, deploy apache or nginx, etc. But there are lots of tutorials on these things. The automated snapshots and backups are nice, though they happen at the filesystem level, and to “do it right” you should also make data-level backups of your database. Also, be aware that they will occasionally need to perform maintenance on your hosts, and suspend and resume your server, resulting in brief downtime.

      The upside is they are quite affordable, and you aren’t tied to a proprietary Amazon infrastructure. Linode and Digital Ocean both offer flat monthly costs for a quantity of resources, so if a job spirals out of control and uses 100% cpu for a week, it won’t increase your bill.

Re: AWS EC2 and Perl
by cavac (Parson) on Oct 27, 2021 at 09:26 UTC

    For the last 15 (or so) years i have my own hardware in a Colo. It's not the cheapest solution, but it has turned out to be very reliable and flexible. It's easy enough to upgrade the hardware if your really have to (as long as the colo is in driving distance) and you have *fixed* costs every month.

    All my stuff (Host with big database + 2 VMs) and a VM of a friend is currently running on a 10 year old 4 Core Intel Xeon at 3.3 Ghz with 32 Gigs of RAM.

    Owning your own server hardware has pros and cons. But for me, the pros are in the majority. When it's your own hardware, you can really adapt it to your requirements, install a Raid controller of your choice etc. If you need a GPU for some neural network stuff, it's a one-time cost instead of paying for the service on a monthly basis (or on some weird "GPU cycles used" scheme).

    After the initial setup it doesn't take all that much extra time for system admin stuff except for the occasional "sudo apt update && sudo apt dist-upgrade && sudo reboot". The rest of the work is, just as in any other server solution, spent on keeping the software working. As for the initial setup, this can be less stressful that the usual rent-a-server solutions, because you can set up and test the server in the comfort of your home without the worry that you shut yourself out of the system by accident by changing something network related...

    perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

      Thanks for the suggestion.
      I've just looked and found that one of the first results from a Google search has a datacentre in my hometown. So definitely worth looking into...

        Look into it but also be aware that your responsibilities for colo are even greater than for a managed solution. Not only are you responsible for the data (incl backups), the applications and the O/S but now also for the hardware, the BIOS, the networking kit within the rack, etc. If anything inside the rack fails in the middle of the night it will be up to you to fix it - and that often includes physically travelling to to the datacentre.

        Colo does have its merits and if, like cavac, you need/want hardware or a networking configuration which is too niche for a managed provider then it can be a good solution. Also of course for big firms who can afford all the redundancy needed to offset some of the downsides.

        We stopped using colo more than a decade ago and it was the right decision for us. YMMV.


        🦛

Re: AWS EC2 and Perl
by Anonymous Monk on Oct 22, 2021 at 05:17 UTC
    Unfortunately it is (of necessity) a broad qn.

    Basically, you are going to have to cost it out yourself by asking your current provider and Amazon/Google/MS what the cost would be for the resources you need ... & taking into account who is going to Admin it.

    Sorry I can't be more definitive.

    Cheers
    Chris
    PS It also depends on whether you can bill anyone for the work it does.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11137796]
Approved by choroba
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-18 17:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found