简体   繁体   English

极慢的Cloud vs VPS(Amazon,Jelastic)

[英]Extreme slowdown Cloud vs VPS (Amazon, Jelastic)

We are trying to move one of our web-services (Java) to the cloud from a development server, here are the details: 我们正在尝试将我们的一种Web服务(Java)从开发服务器移至云端,以下是详细信息:

There is a PHP front-end, connecting to a Java-based web-service that is connected to a MySQL database (all requests to the database are sent from the web-service, the php part is communicating with the Java back-end only, no direct connection to the database). 有一个PHP前端,它连接到连接到MySQL数据库的基于Java的Web服务(对数据库的所有请求都是从Web服务发送的,php部分仅与Java后端通信,则无法直接连接到数据库)。

Start Point 起点

Dev Server - CentOS (cPanel), 765MB-1.5GB RAM, 4CPU, Tomcat 7 开发服务器-CentOS(cPanel),765MB-1.5GB RAM,4CPU,Tomcat 7

* the software is running fast , no speed issues, logs show normal CPU and memory usage * 该软件运行速度快 ,没有速度问题,日志显示正常的CPU和内存使用情况

Scenario #1 场景1

PHP front-end on Elastic Beanstalk and Java web-service with database on Elastic Beanstalk Elastic Beanstalk上的PHP前端以及Elastic Beanstalk上的数据库的Java Web服务

* the software is about 80% slower , logs show normal CPU and memory usage * 该软件的运行速度降低了约80% ,日志显示正常的CPU和内存使用情况

Scenario #2 场景2

PHP front-end on VPS (same company/location with Jelastic) and Java web-service with database on Jelastic VPS上的PHP前端(与Jelastic相同的公司/位置)和Jelastic上具有数据库的Java Web服务

* the software is about 70% slower , logs show normal CPU and memory usage * 该软件的运行速度降低了约70% ,日志显示正常的CPU和内存使用情况

Scenario #3 场景3

PHP front-end on VPS, Java web-service with database on Elastic Beanstalk and Jelastic (swithing) VPS上的PHP前端,Elastic Beanstalk和Jelastic上具有数据库的Java Web服务(已切换)

* the software is about 70-80% slower , logs show normal CPU and memory usage on both cloud environments * 该软件的运行速度降低了约70-80% ,日志显示两种云环境下的正常CPU和内存使用情况

What I figured out, no matter where the PHP front-end is located, that will load fast, nothing to search here. 我想出了什么,无论PHP前端位于何处,都将快速加载,此处无须搜索。

As soon as the Java back-end is moved from the VPS to the cloud (doesn't matter if Amazon or Jelastic), the whole software slows down extremely. 一旦将Java后端从VPS迁移到云(无论是Amazon还是Jelastic都无关紧要),整个软件就会非常慢。 Based on the logs and since we tried with two providers, this doesn't seem like a resource issue. 根据日志,并且由于我们尝试了两个提供程序,因此这似乎不是资源问题。

It cannot be a connection issue since we tried to have the PHP and Java in the same environment (Scenario #1). 由于我们试图将PHP和Java放在同一环境中(方案1),所以它不可能是连接问题。

It is either the Java web-service slowing down extremely (for unknown reason as logs show low resource usage) or it could be the connection between the Java application and the database (I doubt since in the first scenario, all three components are on Amazon, same environment, location). 它要么是Java Web服务的运行速度极慢(由于未知原因,因为日志显示资源使用率较低),要么是Java应用程序与数据库之间的连接(我怀疑,在第一种情况下,这三个组件都在Amazon上) ,相同的环境,位置)。

Anyone ever had such an issue before? 有人以前有过这样的问题吗? Any ideas? 有任何想法吗? Thank you! 谢谢!

(note, I have zero experience with cloud hosting) (请注意,我对云托管的经验为零)

For high performance Java cloud backend, you can try Jelastic implementation by Elastx - see the performance research that CloudSpectator did on them (they also used Amazon and Rackspace cloud in the study): http://blog.jelastic.com/wp-content/uploads/2013/09/Elastx-Fueld-by-SolidFire-9-5-13+Jelastic.pdf 对于高性能Java云后端,您可以尝试Elastx的Jelastic实现-请参阅CloudSpectator对它们进行的性能研究(他们在研究中还使用了Amazon和Rackspace云): http : //blog.jelastic.com/wp-content /uploads/2013/09/Elastx-Fueld-by-SolidFire-9-5-13+Jelastic.pdf

Also, I do not know who your current Jelastic provider is, but if you contact them by clicking Help / Contact Support in Jelastic dashboard, I am sure that they will be happy to troubleshoot the issue! 另外,我不知道您当前的Jelastic提供商是谁,但是如果您通过单击Jelastic仪表板中的“ 帮助 / 联系支持”与他们联系 ,我相信他们很乐意为您解决问题! If this does not help - please ping me offline. 如果这样做没有帮助-请ping我离线。

It might be related to specific parameters in configuration files, mostly for DB. 它可能与配置文件中的特定参数有关,主要是针对DB。 Please double check that they are the same in each test. 请仔细检查它们在每次测试中是否相同。 Also it is not clear how you measure performance and what "slower" exactly means. 同样不清楚如何衡量性能以及“较慢”的确切含义。 And you have not specified size of resources on Jelastic and EB. 您还没有指定Jelastic和EB的资源规模。 Please double check that resources are equal as well. 请仔细检查资源是否相等。

What you are measuring is CPU an memory. 您要测量的是CPU内存。 Since both give normal results, and your application is communicating over the network, I'd suspect network latency to be the culprit. 由于两者均能提供正常结果,并且您的应用程序正在通过网络进行通信,因此我怀疑网络延迟是罪魁祸首。 Next thing to look into would be for example disk I/O performance, which can slow down your application like having a handbrake. 接下来要研究的是例如磁盘I / O性能,它可能会降低您的应用程序的速度,就像手刹一样。

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

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