首页 \ 问答 \ 为Google Cloud App Engine灵活环境指定区域(Specify Zone for Google Cloud App Engine Flexible Environment)

为Google Cloud App Engine灵活环境指定区域(Specify Zone for Google Cloud App Engine Flexible Environment)

问题:有没有办法为Google Cloud App Engine灵活环境指定区域? 如果没有,有哪些替代方案?

上下文:我正在使用App Engine来编写和读取Bigtable。 但是我发现性能有所下降,在调试过程中,我发现Google文档说明:

网络连接存在问题。 网络问题可能会降低吞吐量并导致读取和写入时间比平时长。 特别是,如果您的客户端未与Cloud Bigtable集群在同一区域中运行,您将看到问题。

就我而言,我的客户处于不同的区域,通过将其移动到同一区域,性能大幅提升。 但是,性能问题仍然存在,文档中的建议是将客户端放在与Bigtable相同的区域中。

我还考虑使用容器引擎或计算引擎,它更容易指定区域,但我希望继续使用App Engine来实现其自动缩放功能和托管服务。


Question: Is there a way to Specify Zone for Google Cloud App Engine Flexible Environment to reside in? If not, what are the alternatives?

Context: I'm having a setup where I use App Engine to write and reads to Bigtable. However I noticed a performance decrease, and during the debugging, I found a documentation from Google stating:

There are issues with the network connection. Network issues can reduce throughput and cause reads and writes to take longer than usual. In particular, you'll see issues if your clients are not running in the same zone as your Cloud Bigtable cluster.

In my case, my client is in a different region, by moving it to the same region had a huge increase in performance. However the performance issue still exist, and the recommendation from the documentation is to put client in the same zone as Bigtable.

I also considered using Container engine or Compute Engine where it is easier to specify the zone, but I want stay with App Engine for its autoscale functionality and managed services.


原文:https://stackoverflow.com/questions/46793277
更新时间:2022-06-23 06:06

最满意答案

我解决了这个问题。 我将$scope.chartOptions传递给一个函数,根据一些其他参数向它添加属性。 我正在为几个图表执行此操作,因此我克隆了$ scope.chartOptions并修改了它的克隆版本,最终将这些克隆传递给图表的构造函数。

问题:为了克隆对象,我正在做一个对象的浅拷贝,如这里所解释的,集合的浅拷贝是集合结构的副本,而不是元素。 出于这个原因,我失去了onProgress和onComplete函数。

所以我使用了angular.copy($scope.chartOptions)


I solved the issue. I was passing $scope.chartOptions to a function to add attributes to it depending on some other parameters. I was doing this for several charts, so I cloned $scope.chartOptions and modified the cloned versions of it, to finally pass these clones to the charts' constructor.

The problem: In order to clone the object I was doing a shallow copy of the object, and as explained here, a shallow copy of a collection is a copy of the collection structure, not the elements. For this reason I was losing the onProgress and onComplete functions.

So I used angular.copy($scope.chartOptions).

相关问答

更多
  • 实际上,您并不需要链接解决方案的所有复杂性,因为 您打算不显示轴线(我从图像中看到您将设置图表背景和比例颜色相同)和 您已经对比例开始值和结束值进行了硬编码(我假设您知道数据的值范围并且不需要自动计算) - 如果此条件不适合您,请参阅替代解决方案 有了这些警告,你只需要进行一些更改(只需在选项名称上按Ctrl + F找到要替换的行) scaleSteps: 5, // Number - The value jump in the hard coded scale scaleStepWidth: 50, // ...
  • 有一个onAnimationComplete选项,您可以指定在动画完成后运行内容。 请参阅文档的此部分 。 例 var ctx = document.getElementById("chart").getContext("2d"); var myLine1 = new Chart(ctx).Line(lineChartData1, { onAnimationComplete: function() { alert('animation complete') } }); 小提 ...
  • 基本上,在完成动画绘制文本之前,您需要检查特定数据集是否隐藏。 要完成此操作,您只需使用以下内容替换onComplete函数即可... "onComplete": function() { var chartInstance = this.chart, ctx = chartInstance.ctx; ctx.font = Chart.helpers.fontString(Chart.defaults.global.defaultFontSize, Chart.defaults.g ...
  • 有一个新的数据集选项spanGaps ,允许连接点与它们之间的间隙。 Github提交参考: https://github.com/chartjs/Chart.js/commit/77357e57d6f5ae44ba10bf22b06219850df4df5f There is a new dataset option spanGaps that allows to connect dots with gaps between them. Github commit for reference: https ...
  • 使用名为chartjs-plugin-datalabels的Chart.js插件可以轻松实现这一点 。 以下是此插件需要设置的最小选项,以显示堆叠条形图内部(中间)的值: options: { //your chart options plugins: { datalabels: { display: true, align: 'center', anchor: 'center' } } } 虽然,您可以使用大量其他 ...
  • 这是因为旋转后您没有恢复画布状态。 您应该将其恢复到外部,而不是在if语句中恢复它,如下所示: ... if (bar._datasetIndex == 0) { ctx.fillText(bar._model.label, 0, 0); } ctx.restore(); //<- restore canvas state ... 另外,你应该更好地创建一个插件 (以防止标签闪烁),而不是在动画完成时绘制标签。 这是JSFiddle的工作示例 This is because you are not ...
  • 对于这种情况,你应该使用“onProgress”而不是“onComplete”。 试试这个代码: animation: { onProgress: function () { var chartInstance = this.chart, ctx = chartInstance.ctx; ctx.textAlign = 'center'; ctx.fillStyle = "rgba(0, 0, 0, 1)"; ...
  • 我解决了这个问题。 我将$scope.chartOptions传递给一个函数,根据一些其他参数向它添加属性。 我正在为几个图表执行此操作,因此我克隆了$ scope.chartOptions并修改了它的克隆版本,最终将这些克隆传递给图表的构造函数。 问题:为了克隆对象,我正在做一个对象的浅拷贝,如这里所解释的,集合的浅拷贝是集合结构的副本,而不是元素。 出于这个原因,我失去了onProgress和onComplete函数。 所以我使用了angular.copy($scope.chartOptions) 。 ...
  • 您可以扩展图表以从x轴中删除不需要的点,如此(改编自https://stackoverflow.com/a/31606933/360067 ) Chart.types.Line.extend({ name: "LineAlt", initialize: function (data) { Chart.types.Line.prototype.initialize.apply(this, arguments); if (this.options.every) ...
  • 您的代码期望主代码中的ctx值与您的扩展名不同。 在您的主代码中,它看起来像一个DOM节点,在您的扩展中,您将它用作上下文。 只需添加 var ctx = this.chart.ctx; 在Chart.types.Line.prototype.draw.apply(this, arguments);之后Chart.types.Line.prototype.draw.apply(this, arguments); 它应该工作。 如果没有,检查您的主代码变量是否都使用正确的值定义( start , end ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)