app.yaml中的GAE处理程序,多次具有相同的脚本值会导致性能问题?

时间:2016-04-06 13:43:49

标签: google-app-engine

根据我的理解,我将app.yaml配置如下:

handlers:
- url: /_ah/queue/?
  script: wsgi.application
  login: admin

- url: .*
  script: wsgi.application

它背后的想法是完整的应用程序由相同的代码库(队列和Web服务)管理。 由于我不想让我的用户访问队列URL(/ _ah / queue / {queue_name}),因此我添加了login: admin限制,其余的人都可以访问它。

但是我想知道添加相同的script: wsgi.application是一种好方法还是我在这里做错了什么?

1 个答案:

答案 0 :(得分:1)

对多个处理程序使用相同的script:值没有问题,事实上即使在Script handlers section of the Configuring with app.yaml doc的示例中也可以看到:

handlers:
# The root URL (/) is handled by the WSGI application named "app" in home.py.
# No other URLs match this pattern.
- url: /
  script: home.app

# The URL /index.html is also handled by the home.py script.
- url: /index\.html
  script: home.app

script:语句只是将处理程序脚本/应用程序映射到相应的url模式,对于具有相同处理程序的多个模式没有任何不好。