Results 1 to 15 of 15
  1. #1

    Question 4 Samll EC2 instances vs. 1 Large EC2 instance

    I'm trying to understand what is the best configuration when setting up a site on Amazon EC2. 4 small instances cost the same as one large instance, and have roughly the same resources. The main difference I see is that these are 32-bit instances, whereas the large instance is 64-bit. How will the performance compare on these two configurations (to be more specific, they will be running either CentOS or Amazon Linux, PHP, MongoDB, and Nginx)?

  2. #2
    Join Date
    May 2011
    Location
    Geneva, Switzerland
    Posts
    17
    Not sure to understand the '32 bit instance' vs '64 bit instance'; are you sure you didn't mess up with the operating system ?

    I'd first consider your needs; how many clients/requests you'd have on your server ? In the case of having 4 instances, i suppose you'd want to split the database, webserver and reverse proxy among them; then it will become a little more complicated than having everything in one single server.

    I'd suggest you start small; see what are the results, and then grow if needed. It's a very common mistake (that I did as well) to start too big.

    Maybe you can tell us more about your requirements, i'd be pleased to help.

  3. #3
    The Amazon EC2 small instances are only available as 32-bit, not 64-bit. The small instances only have 1.7GB of RAM, so I'm not sure if 64-bit is needed, but it seems like it would still speed up other operations?

    I was more asking this as a general question to try and understand how all of this works better. Complexity shouldn't be a factor here as more instances would need to be added to a large as well if things went well (so maybe I should be asking how the performance would compare between 8xsmall and 2xlarge).

  4. #4
    It really depends if you can run your app well in a distributed environment

  5. #5
    Well you can't just scale vertically forever, so I have to use a distributed environment as I grow, there is no way around it.

  6. #6
    Join Date
    Nov 2009
    Posts
    544
    Quote Originally Posted by schooglepets View Post
    Well you can't just scale vertically forever, so I have to use a distributed environment as I grow, there is no way around it.
    Yep and sooner or later you are going to have to understand the resources used by each user interacting with your application.

    Comparing two platforms, without knowing the application that you plan to use, is a useless exercise. Once you understand the resources required per user and the number of users you plan to support you will find other questions pertaining to hosting your application are much easier to answer.

  7. #7
    Quote Originally Posted by srfreeman View Post
    Yep and sooner or later you are going to have to understand the resources used by each user interacting with your application.

    Comparing two platforms, without knowing the application that you plan to use, is a useless exercise. Once you understand the resources required per user and the number of users you plan to support you will find other questions pertaining to hosting your application are much easier to answer.
    When did I try to compare 2 different platforms? I'm simply asking about 2 different configurations on Amazon EC2.

  8. #8
    Join Date
    Nov 2009
    Posts
    544
    Ok, to clarify;

    Comparing two different configurations on Amazon EC2, without knowing the application that you plan to use, is a useless exercise.

  9. #9
    I was simply asking in general terms. It doesn't even have to be EC2. Assume that you have 2 instances that total 16GB of RAM and 8 CPUs, or 8 instances that also total 16GB of RAM and 8 CPUs, which would you choose. Or if you don't want to choose either, how would you make your decision, considering both are distributed across multiple instances?

  10. #10
    Join Date
    Nov 2009
    Posts
    544
    Quote Originally Posted by schooglepets View Post
    I was simply asking in general terms. It doesn't even have to be EC2. Assume that you have 2 instances that total 16GB of RAM and 8 CPUs, or 8 instances that also total 16GB of RAM and 8 CPUs, which would you choose. Or if you don't want to choose either, how would you make your decision, considering both are distributed across multiple instances?
    You seem to be putting the proverbial cart before the horse. It really depends on your application.

    Over simplification:
    If I have an application that requires 16GB of RAM and 8 CPUs to support 500 users and I want to support a maximum of 1000 users - I would choose 2 instances that have 16GB of RAM and 8 CPUs each.

    If I have an application that requires 2GB of RAM and 1CPU to support 500 users and I want to support a maximum of 500 users - I would choose 1 instance that has 2GB of RAM and 1 CPU.

    Certainly there are more criteria that would go into the selection and many more choices to make but hosting an application is not a guessing game. Knowing what you need and how to test for the best platform is the first requirement in the equation.

  11. #11
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    934
    Taking a page from NetFlix's book, they monitor the performance of every instance they spool up from small to large (their encoding farm). From that data, they can build an expected performance/cost and kill any instance that's underperforming.

    Because EC2 instances are dependent on their neighbors due to IO and cache limitations, this is just a price to pay in the cloud.

    As for the 32/64 debate, it doesn't really matter except in the case of MongoDB because of how it uses memory maps for the db. For that specific app, you'll be limited to 2GB databases in 32-bit mode.

  12. #12
    Quote Originally Posted by tchen View Post
    Taking a page from NetFlix's book, they monitor the performance of every instance they spool up from small to large (their encoding farm). From that data, they can build an expected performance/cost and kill any instance that's underperforming.

    Because EC2 instances are dependent on their neighbors due to IO and cache limitations, this is just a price to pay in the cloud.

    As for the 32/64 debate, it doesn't really matter except in the case of MongoDB because of how it uses memory maps for the db. For that specific app, you'll be limited to 2GB databases in 32-bit mode.
    That is what I was wondering about, but does that matter since the instance only has 1.7GB of RAM? Or does that limit it so that you can't have more than 2GB even on disk?

  13. #13
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    934
    It still matters. Memory mapping is a technique to take segments of your hard disk and map it into memory so that from the program's standpoint, they're conveniently addressing memory (but really, its hard drive space). MongoDB will still use the 1.7GB RAM and fill it up with indices and cached row docs, but that part doesn't care about 32-bit limitations.

    The limit is the addressable space.

    Just a note, even on 64-bit machines, MongoDB will just stop at 2GB file sizes for the DB. But it will create multiple files and span across them in the memory map since it can just shift the address space.

  14. #14
    Quote Originally Posted by tchen View Post
    It still matters. Memory mapping is a technique to take segments of your hard disk and map it into memory so that from the program's standpoint, they're conveniently addressing memory (but really, its hard drive space). MongoDB will still use the 1.7GB RAM and fill it up with indices and cached row docs, but that part doesn't care about 32-bit limitations.

    The limit is the addressable space.

    Just a note, even on 64-bit machines, MongoDB will just stop at 2GB file sizes for the DB. But it will create multiple files and span across them in the memory map since it can just shift the address space.
    So in other words, if I need a MongoDB database larger than 2GB, the small instances aren't an option?

  15. #15
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    934
    that's right

Similar Threads

  1. Amazon EC2?
    By Steven F in forum Cloud Hosting
    Replies: 4
    Last Post: 03-14-2011, 06:30 PM
  2. EC2 Clusters and Instances
    By MadFastRide in forum Cloud Hosting
    Replies: 0
    Last Post: 02-10-2011, 11:00 PM
  3. Amazon EC2 - any good?
    By Ultraspeed in forum Web Hosting
    Replies: 0
    Last Post: 02-15-2010, 11:31 AM
  4. Amazon EC2
    By txitcs in forum Web Hosting
    Replies: 7
    Last Post: 04-22-2009, 10:39 AM
  5. Amazon EC2
    By Rich in forum Programming Discussion
    Replies: 3
    Last Post: 09-05-2008, 03:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •