简体   繁体   English

具有相同性能的AWS EC2微型和中型实例吗?

[英]AWS EC2 micro and medium instances with same performance?

Im developing an AngularJS (frontend) and Rails API (backend) project. 我正在开发AngularJS(前端)和Rails API(后端)项目。 My development environment has been running on an AWS EC2 micro instance. 我的开发环境已在AWS EC2微型实例上运行。 Now, its time to go live, so I chose a medium instance. 现在,它可以上线了,所以我选择了一个中等实例。 I thought the performance improvement was going to be awesome, but instead of that, my feeling is they are more or less the same. 我以为性能改进会很棒,但是相反,我的感觉是它们或多或少都是相同的。

You can check it by yourself. 您可以自己检查。

Development environment: http://ec2-54-76-16-85.eu-west-1.compute.amazonaws.com/ Preproduction environment: http://ec2-54-76-117-208.eu-west-1.compute.amazonaws.com/ 开发环境: http://ec2-54-76-16-85.eu-west-1.compute.amazonaws.com/预生产环境: HTTP://ec2-54-76-117-208.eu-west- 1.compute.amazonaws.com/

What am I missing? 我想念什么? It takes too long to load the main page. 加载主页花费的时间太长。 But I don´t know where is the bottelneck or how can I improve the performance. 但是我不知道bottelneck在哪里或如何提高性能。 Should I use cloudfront for the static images. 我是否应该将cloudfront用于静态图像。

Anyway, you can see it takes time to load even the text translations. 无论如何,您甚至可以看到加载文本翻译也需要时间。

Any suggestions how to improve this? 有什么建议可以改善这一点吗?

Check cloudwatch for the instance monitoring of both instances, you probably have a shared bottleneck. 检查cloudwatch以了解两个实例的实例监视,您可能有一个共享的瓶颈。 Could it be they use the same database for example? 例如,是否可以使用相同的数据库?

What Julio said about shared resources must be check first. Julio关于共享资源的说法必须首先检查。 Keep looking at the CloudWatch that's very important. 继续关注非常重要的CloudWatch。

Regarding the performance improvement. 关于性能改进。 Use CloudFront or S3 for images, CSS, js etc. that's the first step for reducing the burden on you instance. 为图像,CSS,js等使用CloudFront或S3。这是减轻实例负担的第一步。

Micro instance is a special instance type. 微型实例是一种特殊的实例类型。 Actually speaking micro is roughly can exceed the performance and infra power than small instance. 实际来讲,微型是比小型实例可以超越性能和红外线的。 It belongs to a place between small and medium instance interms of compute power. 它属于中小型计算能力实例之间的地方。

Here is little gist about the way micro instance behaves. 关于微实例行为的方式,这里没有什么要点。 It is meant to work on occasional burst compute intensive task. 它旨在处理偶尔的突发计算密集型任务。 That occasional max threshold is actually bigger than the range of small instance. 偶尔的最大阈值实际上大于小实例的范围。 The number times you hit the max threshold, that many times you are penalised for hitting the max. 达到最高阈值的次数,达到最高阈值的次数很多。 On that event of hitting the upper limit of the compute power, your micro's compute power is cut down to great extend. 一旦达到计算能力的上限,微型计算机的计算能力就会大大降低。 After some time, the cut down threshold is removed and your instance is back to normal. 一段时间后,删除阈值将被删除,您的实例恢复正常。 If again when you hit the max threshold again, you will be penalised again but this time for even long duration. 如果再次达到最大阈值,将再次受到处罚,但这一次甚至持续很长时间。 This way, if the trend continues, your app will behave very badly over a period of time. 这样,如果趋势持续下去,您的应用将在一段时间内表现很差。 With micro occasional spikes are good but not frequent burst. 微小的峰值是不错的,但不是经常爆发。 The idea behind the micro is for burst compute and shared compute (process capability). 微型计算机背后的想法是用于突发计算和共享计算(过程功能)。 Small instance is for guaranteed memory and compute power ( actually all instance other than micro ) 小实例是为了保证内存和计算能力(实际上是除micro之外的所有实例)

Now speaking of the comparison of the micro and medium. 现在谈到微观和中等的比较。 The effect what you observed is correct and it actually anticipated behaviour. 您观察到的效果是正确的,并且实际上是预期的行为。 What differs from medium and micro is the memory. 存储器与中,微存储器不同。 Chances are your app is compute intensive and thus the behaviour is as not as overwhelming as you have anticipated. 您的应用很可能需要大量计算,因此其行为并不像您预期​​的那样繁重。

I suggest you to check your app with large instance for few hours with few CloudWatch metics and see the performance. 建议您使用几个CloudWatch指标检查大型实例的应用程序几个小时,然后查看性能。 The comparison between micro and medium, wouldn't be like 3x performance improvement as you think of ( I am guess are thinking of ranking as micro, small and then medium so 3 times up ) 微型和中型之间的比较不会像您想到的那样提高3倍的性能(我想是在考虑将微型,小型然后中型的排名提高3倍)

First suggestion would be using pipeline for your assets. 第一个建议是为您的资产使用管道。 At the moment you have many individual calls to individual CSS and JS files. 目前,您对单个CSS和JS文件有很多单独的调用。

CSS: CSS:

<link rel="stylesheet" href="css/app.css"/>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">           
<link rel="stylesheet" href="css/contacts.css">
<link rel="stylesheet" href="css/options.css">
<link rel="stylesheet" href="css/welcome.css">  
<link rel="stylesheet" href="css/new-business.css">
<link rel="stylesheet" href="css/boat-booking.css">
<link rel="stylesheet" href="css/icons.css">
<link rel="stylesheet" href="css/menus.css">    
<link rel="stylesheet" href="css/booking.css">
<link rel="stylesheet" href="css/join-us.css">
<link rel="stylesheet" href="css/user.css">
<link rel="stylesheet" href="css/social-buttons.css"> 
<link rel="stylesheet" href="css/font-awesome.min.css" />   
<link rel="stylesheet" href="css/font-awesome-ie7.min.css" />       
<!-- SELECT -->
<link rel="stylesheet" href="css/prettify.css">
<link rel="stylesheet" href="css/bootstrap-select.css">  
<!-- SWITCH -->
<link rel="stylesheet" href="css/angular-toggle-switch-bootstrap.css"/>
<link rel="stylesheet" href="css/angular-toggle-switch.css"/>  
<!-- SLIDER -->
<link rel="stylesheet" href="css/slider.css"/>
<link rel="stylesheet" href="css/lightbox.css" />
<link rel="stylesheet" href="css/angular-growl.min.css" />  <!-- Notifications -->
<!-- Progress bar -->
<link rel="stylesheet" href="css/ngProgress.css" />

JS: JS:

    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>  
<script src="lib/plugins/file-upload/angular-file-upload-shim.min.js"></script> 
<script src="lib/angular/angular.js"></script>
<script src="lib/angular/angular-resource.js"></script>
<script src="lib/angular/angular-sanitize.js"></script>
<script src="lib/angular/angular-cookies.min.js"></script>
<!--<script src="http://rawgithub.com/SlexAxton/messageformat.js/master/messageformat.js"></script>-->
<script src="lib/plugins/angular-translate.min.js"></script>
<script src="lib/plugins/angular-translate-loader-static-files.min.js"></script>
<!--<script src="http://rawgithub.com/angular-translate/bower-angular-translate-interpolation-messageformat/master/angular-translate-interpolation-messageformat.min.js"></script>-->
<script src="js/ui-bootstrap-tpls-0.6.0.min.js"></script>       
<script src="lib/bootstrap/bootstrap.js"></script>
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>
<script src="js/controllers/home.js"></script>
<script src="js/controllers/boat-list.js"></script>
<script src="js/controllers/boat.js"></script>      
<script src="js/controllers/boat-booking-payment.js"></script>
<script src="js/controllers/boat-services-payment.js"></script>
<script src="js/controllers/login.js"></script>
<script src="js/controllers/location.js"></script>
<script src="js/controllers/user-dashboard.js"></script>
<script src="js/controllers/business.js"></script>
<script src="js/controllers/file-upload.js"></script>
<script src="js/controllers/searcher.js"></script>
<script src="js/controllers/reset-password.js"></script>
<script src="js/controllers/about.js"></script>
<script src="js/controllers/shopping-cart.js"></script>
<script src="js/controllers/user-plans.js"></script>
<script src="js/controllers/user-plan-payment.js"></script>
<script src="js/controllers/demo.js"></script>
<script src="js/controllers/account.js"></script>
<script src="js/controllers/help.js"></script>
<script src="js/controllers/join-us.js"></script>
<script src="js/controllers/account.js"></script>
<script src="js/controllers/accordion.js"></script>
<script src="js/controllers/boat-model.js"></script>
<script src="js/controllers/new-boat-payment.js"></script>
<script src="js/controllers/what-to-do.js"></script>
<script src="js/controllers/privacy.js"></script>
<script src="js/controllers/terms.js"></script>
<script src="js/filters.js"></script>
<script src="js/directives.js"></script>    
<script src="js/i18n.js"></script>  
<script src="js/properties/properties.js"></script>     
<script src="lib/plugins/file-upload/angular-file-upload.min.js"></script>
<!-- SELECT -->
<script src="lib/plugins/angular-strap.js"></script>
<script src="lib/bootstrap/bootstrap-select.js"></script>
<!-- SWITCH -->
<script src="lib/plugins/angular-toggle-switch.min.js"></script>
<!-- SLIDER -->
<script src="lib/bootstrap/bootstrap-slider.js"></script>
<!-- SPINNER -->
<script src="js/spin.min.js"></script>
<script src="lib/plugins/angular-spinner.min.js"></script>
<!-- LIGHTBOX -->
<script src="lib/bootstrap/lightbox-2.6.min.js"></script>
<!-- OAUTH -->
<script src="js/oauth.min.js"></script>
<!-- Growl notifications -->
<script src="lib/plugins/angular-growl.js"></script>
<!-- Custom HTML popover
<script src="lib/plugins/custom-popover.js"></script>-->
<!-- Countdown Timer -->
<script src="lib/plugins/angular-timer.min.js"></script>
<!-- CART -->
<script src="js/shopping-cart.js" type="text/javascript"></script>
<!-- Chart -->
<!--<script src="lib/plugins/d3.min.js" type="text/javascript"></script>-->
<script src="lib/plugins/angular-charts.min.js" type="text/javascript"></script>
<!-- Progress bar -->
<script src="lib/plugins/ngProgress.min.js" type="text/javascript"></script>
<!-- Angular moment -->
<script src="lib/plugins/moment-with-langs.min.js"></script>
<script src="lib/plugins/angular-moment.min.js"></script>
<!-- Stripe -->
<script src="https://checkout.stripe.com/checkout.js"></script>
<!--  Angular-dynamic-locale -->
<script src="lib/plugins/tmhDynamicLocale.js"></script>

Reduce these down to two queries plus external resources will see a big improvement in your load times. 将这些减少到两个查询,再加上外部资源将大大缩短您的加载时间。 Indeed, looking at the refresh-without-cache shows that there is a big limitation being placed by the fact that you're loading individual files. 确实,查看没有缓存的刷新表明,由于要加载单个文件,因此存在很大的限制。

Indeed that's the top two recommendations advised by Google Chrome's Audit tool (along with browser caching, proxy caching 确实,这是Google Chrome浏览器审核工具建议的最重要的两项建议(以及浏览器缓存,代理缓存)

屏幕截图-页面个人资料建议

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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