简体   繁体   中英

AWS EC2 free tier django app

testing a simple Django application on ec2 free tier ubuntu and when ~10 people is online on the site it goes to 100% cpu load, then crumbles for hours to get back up.

Could the free tier be that bad? or anything wrong with using mod_wsgi, nginx, django together? I've used this guide to get it work on the server: https://gist.github.com/evildmp/3094281

I guess, you are using "micro" instance (I do not think, other instances are availble via free tier).

(mirco) Power

With "mirco", be aware of following rules:

  • it allows temporarily (a minute or two) to use up to 4 time more, then average load.
  • But if you do it a bit longer, you get "penalty" and you instance gets less power for a while (like 30 minutes or more).

Disk performance on small EC2 instances

As disk is connected to EC2 instance, the performance is limited to provided network connectivity. The connectivity is given related to size of your instance, so "micro" gets less than small etc.

There are some instance types with SSD, but this is definitely not the case of "micro".

I use "small" instance and I have to say, disk performance is poor. You might get more by attaching multiple EBS volumes in stripe, but this is a bit more work.

Conclusion

Micro has micro power.

It is likely, the bottleneck results from your use of database, which performs very poorly on disk access provedid by micro instance.

Amazon free tier includes 750 hours of t1.Micro instances only. They are meant for learning and testing purposes and will not fit for production environment usage. You can use Linux, RHEL, SLES or Windows Micro Instance for 750 hours.

The t1.micro instance consists of 1 vCPU and 0.613 GB memory with EBS only storage . This certainly will not give you the performance you expect, that too when multiple users use it.

But the micro instance come with burst capabilities for short CPU capacity increases. You can use them for low traffic websites or blogs, small administrative applications, and free trials to explore EC2 functionality.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM