fe_81 Posted November 4, 2010 Share Posted November 4, 2010 Hi, Could someone please give us some advice on which Amazon instances are suitable for which purpose? I know that this may depend on the type of application you are building, but are probably some general facts. We are building a website, and plan to start with the following setup: - 1 Elastic Load Balancer - 2 EC2 Micro Instance (EBS storage only), used for web servers - 1 EC2 Micro Instance (EBS storage only), used as a caching server (with Memcached) - 1 EC2 Micro Instance (EBS storage only), used for a mail server - 1 RDS Small DB Instance, used for database server What do you think about this setup? We will monitor the system and add more web servers when needed. The cache server and the database server will first be upgraded to better, before adding more of those. Our biggest question is that are micro instances enough for web servers? I have heard that the bottleneck in web servers is rarely CPU and we do not do any complex calculations at the web servers or use https. We use PHP with Zend Framework, which does not require that much memory either. So the question is should we go with several micro instances or fewer larger ones? What are people normally using? We appreciate all help we can get. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/217716-amazon-aws-question-which-instances-to-use-many-micro-instances-vs-few-large/ Share on other sites More sharing options...
gizmola Posted November 4, 2010 Share Posted November 4, 2010 Your first bottleneck will be lack of memory. In my opinion the micro instances are not designed for web servers or caching servers -- they are designed for people who want to run computation clusters. In my experience standard instances are the minimum you want to go with for a lamp server. Secondarily, I would suggest that you plan to run memcached on every webserver. That way there's a good chance that the web server will get the data it needs from memory on the same vm, rather than having to go out through the network and get the data from what could be another machine. Quote Link to comment https://forums.phpfreaks.com/topic/217716-amazon-aws-question-which-instances-to-use-many-micro-instances-vs-few-large/#findComment-1130140 Share on other sites More sharing options...
fe_81 Posted November 4, 2010 Author Share Posted November 4, 2010 Thank you for your answer. Is memory going to be the bottleneck on the web servers even if we do not run Memcached on the same servers? What is it that needs memory? PHP and Apache does not use themselves that much memory, even if we use APC for opt-code caching. Is it so that the need for memory grows considerably when there is heavy traffic? Running Memcached on all web servers is hard to configure, since we want to have an easy way to add new web servers or remove existing ones (possibly use autoscaling at some point). This would require all web servers to be aware of each other. It is obvious that a micro instance cannot be as good as a larger one, but how much worse are they? They are 4 times as cheap, so if less than 4 micro instances are better than one small (default), then the micro instances are probably better. Or does this make any sense at all? -F Quote Link to comment https://forums.phpfreaks.com/topic/217716-amazon-aws-question-which-instances-to-use-many-micro-instances-vs-few-large/#findComment-1130190 Share on other sites More sharing options...
gizmola Posted November 4, 2010 Share Posted November 4, 2010 As your traffic increases, apache will need to fork child processes, so apache itself will take up memory. There will be a pool of these child processes and they will use up whatever chunk of memory needed to be allocated to run the php script. To say that PHP doesn't use up much memory, is highly dependent on what your scripts are doing. You can minimize this by getting apache down to as lean a footprint as possible, but it can still be significant. I've worked on apps where even when we did a lot of memory footprint optimization we still had 30-80mb child processes. These get cycled through and killed after a bit, but it's not unusual that you'll have a script that uses a lot of memory and that stays in the child pool to service other requests. For this reason a lot of people use minimal servers to serve images and javascript and other static resources. At any rate, the more traffic you have, the more memory apache will eat up. As for memcached, the main reason people use it is because it is a distributed cache that they can add new machines to as load rises and the size of the dataset increases. You'd do just as well to optimize the database cache if you're just going to invest in a machine that has a bunch of memory for cache in my opinion. For a small web cluster that you're just starting up with, I would still recommend that you have webserver + memcache for every frontend you need. Quote Link to comment https://forums.phpfreaks.com/topic/217716-amazon-aws-question-which-instances-to-use-many-micro-instances-vs-few-large/#findComment-1130405 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.