Google App Engine的速度有多快? [英] How fast is Google App Engine?

查看:158
本文介绍了Google App Engine的速度有多快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试用最近2个月的GAE。

我通过上传CSV文件将记录保存到bigtable。



我的测试文件大小为300 KB。



这里是我发现的



本地系统


  • 上传时间少于1秒

  • 在3秒内处理2500条记录



在Google Sandbox上




  • 上传需要5-7秒钟。

  • / p>
  • 它只保存60-180条记录。


    我的问题是


      li>为什么需要太多时间?
    1. 有没有办法缩短这个时间?

    2. Google将这个处理计算在CPU使用中。他们不公开h / w,因此他们在内部使用什么样的CPU?我的意思是我得到一个CPU是否等于或大于PIII?


      $ p
      $ b

      编辑为 @Drew Sears 的答案。



      目前我在做什么


      1. 将文件上传至GAE

      2. 获取上传的数据字节。
      3. 有一个唯一的字段id,我的记录。

      4. 现在,我创建了队列

      int x = linesCount / 50;

        {
      x = i * 50;
      队列队列= QueueFactory.getQueue(test-queue);
      queue.add(TaskOptions.Builder.url(/ TestQueue)
      .param(id,id.toString())
      .param(startIdx,String.valueOf (x))
      .param(totRec,String.valueOf(50))
      );
      }

      int y = linesCount%50;
      if(y> 0)
      {
      x =(linesCount / 50)* 50;
      队列队列= QueueFactory.getQueue(test-queue);
      queue.add(TaskOptions.Builder.url(/ TestQueue)
      .param(id,id.toString())
      .param(startIdx,String.valueOf (x))
      .param(totRec,String.valueOf(y))
      );





      $ b

      处理servlet的任务从存储中读取文件并使用totRec和startIdx处理文件并关闭它。

      解决方案

      这实在不是测试App Engine可伸缩性的好方法。 b


      1. 如果需要7秒后才能发布300KB,那么瓶颈几乎就是您的上游带宽,而不是谷歌的下游带宽,或者与App Engine有关。我经常获得更快的上传速度。

      2. 如果您希望请求更快完成,请尽量减少RPC调用。每个数据存储区的获取,放入或查询都是到外部服务器的往返。如果循环数百行并在每次循环迭代中进行put操作,则会产生大量不必要的开销。使用一个数据存储放置所有实体,您将获得更快的结果。 Guido的 AppStats框架是寻找RPC优化机会的绝佳工具。


      I am experimenting with GAE for last 2 Months.

      I am saving records to the bigtable by uploading CSV file.

      My Test File's size is 300 KB.

      Here what i found

      Local system

      • Upload take less than 1 second
      • Process 2500 records in 3 seconds

      On Google Sandbox

      • Upload takes 5-7 seconds.

      • Processing file gives timeout.

      • It only save 60-180 records.

      My questions are

      1. Why it takes too much time?
      2. Is there a way to reduce this time?
      3. Google counts this processing towards CPU uses. They do not disclose h/w so what CPU internally they use? I mean do i get a CPU euquivalent or greater than PIII?


      Edited for @Drew Sears's answer.

      What i am doing at present

      1. Upload the file to GAE
      2. Get uploaded data bytes. By stream, count lines , save it into bigtable.
      3. There is a unique field, id, my Record.
      4. Now, i create queue

      int x = linesCount/ 50;

      for(int i<0;i=x;i++)
      {
              x = i * 50;
              Queue queue = QueueFactory.getQueue("test-queue");
              queue.add(TaskOptions.Builder.url("/TestQueue")
                      .param("id", id.toString())
                      .param("startIdx",String.valueOf(x))
                      .param("totRec",String.valueOf(50))
              );
          }
      
      int y = linesCount % 50;
      if( y > 0 )
      {
          x = (linesCount / 50) * 50;
          Queue queue = QueueFactory.getQueue("test-queue");
          queue.add(TaskOptions.Builder.url("/TestQueue")
                  .param("id", id.toString())
                  .param("startIdx",String.valueOf(x))
                  .param("totRec",String.valueOf(y))
          );                      
      }
      

      The task processing servlet read file from storage and using totRec and startIdx process the file and close it..

      解决方案

      This is really not a great way to test App Engine's scalability.

      1. If it's taking you 7 seconds to post 300KB, the bottleneck is almost certainly your upstream bandwidth, not Google's downstream bandwidth, or anything to do with App Engine. I routinely get much faster upload speeds.
      2. If you want requests to finish faster, minimize your RPC calls. Every datastore get, put, or query is a round-trip to an external server. If you're looping over hundreds of rows and doing a put inside each loop iteration, you're incurring a massive amount of unnecessary overhead. Save all of your entities using one datastore put and you will get much faster results. Guido's AppStats framework is a great tool for finding RPC optimization opportunities.

      这篇关于Google App Engine的速度有多快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆