Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a chat application using stack of Openfire, Tomcat6 and MySQL.

Currently, i have installed all these servers on single Linux micro-instance(613 MB memory). Even in low user base 10-20 i am encountering CPU overload which is quite obvious here.

As, i am new to Amazon EC2 can somebody suggest me how to scale up my architecture according to traffic use?

  • should i use separate micro instances for every app server(openfire,mysql,tomcat6)
  • should i use single small or medium instance for whole server stack.

    Some factors in context:

  • high reliance on MYSQL
  • high memory usage due to file transfer
  • web-application interacting with other Amazon service like S3,SES
share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

I would use at least an m1.small or better an m1.large Instance. The micro-instance really is for development only, because the 613MB may soon not be enough even with zero users. Besides that, you will most likely see a lot of CPU steal time and your Server will not react some time after you had a small cpu peak. That is very annoying.

I would try to get the whole stack running on each instance except of the mysql-db. Take a look at RDS! You dont need to setup a high avalailability mysql master-slave infrastrucure yourself!

share|improve this answer
    
thanks for insight. Ya i knw RDS would have been a much better option in this case. As my application is nearly completed so i am little bit apprehensive about doing architectural changes. –  shashankaholic Jun 7 '12 at 10:54
    
If i go with single m1.large instance. have i need to reinstall every thing from scratch or is there a way to upgrade my micro to large instance, just like that, and everything works. –  shashankaholic Jun 7 '12 at 10:56
2  
Just stop the instance, change the type (right click on instance in web gui), and start it. Nothing will be lost. –  dusan.bajic Jun 7 '12 at 11:33
add comment

Don't use micro instances for production due to their unpredictable CPU throttle. It is more cost effective to run everything at single instance, but if you are planning to grow and scale it is better to design and develop your application in several instances.

share|improve this answer
add comment

In the long term it will be preferable to separate the application server from the database to allow maximum flexibility and scalability of each tier. RDS is a good option for now, but keep in mind it is limited to a single instance, if you have an unexpected surge of traffic beyond the capacity of the biggest instance, you might experience downtime, and then you'll need to set up clustering with additional instances, which is complex. Another option on EC2 is Xeround's cloud database service, it is different from RDS in that it can auto-scale to additional instances to accommodate additional throughput and handles the clustering automatically. As for the application server, you can auto scale it with Amazon's CloudWatch feature.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.