Python函数 [英] Python Function

查看:64
本文介绍了Python函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行我的功能时遇到了一个奇怪的问题。当我增加循环中的项目数时,该函数将不会运行,我只在日志输出中得到以下内容:



2019-04-13T14: 24:53 欢迎您,您现在已连接到日志流服务。

2019-04-13T14:24:56.773 [信息]执行'Functions.finn-old-homes'(Reason ='此功能是以编程方式进行的通过主机API调用。',Id = 830c1f21-f356-4408-996d-14405f629e11)

2019-04-13T14:26:53 在过去的1分钟内没有新的痕迹。



但是,当我的循环中的项目数量很少时,该函数运行没有问题。我不知道为什么。以下是我的函数中的python脚本之间的差异:
$


运行:为$N
,范围内的PageNum(1,5):

for Link in LinkList [:5]:

for code in go_missing [:5]:



Won' t run:
$
for PageNum in range(1,2500):

for Link in LinkList:

for code in go_missing:


可能导致此问题的原因是什么?

解决方案

< blockquote>

当您增加循环中的项目数时,您是否在"可用性和性能"部分中观察到CPU或内存透视图的任何增加。您可以按照以下步骤进行检查。


从门户网站转到功能应用程序
à 平台功能
à 诊断和解决问题 à 可用性
和性能


功能应用可能会达到一些阈值,因此你会观察到一些奇怪的行为。


目前是功能应用程序的最大可用内存在消费计划上是1.5 GB并且在专用实例上运行( Basic,Standard,Premium,
和Isolated SKU
它取决于运行功能应用程序的SKU。


I'm having a strange issue running my functions. When I increase the number of items in my loops, the function won't run and I only get the following in the logs output:

2019-04-13T14:24:53  Welcome, you are now connected to log-streaming service.
2019-04-13T14:24:56.773 [Information] Executing 'Functions.finn-old-homes' (Reason='This function was programmatically called via the host APIs.', Id=830c1f21-f356-4408-996d-14405f629e11)
2019-04-13T14:26:53  No new trace in the past 1 min(s).

However, when the number of items in my loops is small, the function runs without problem. I have no idea why. Here are the differences between the python scripts in my function:

Runs:
for PageNum in range(1, 5):
for Link in LinkList[:5]:
for Code in went_missing[:5]:

Won't run:
for PageNum in range(1, 2500):
for Link in LinkList:
for Code in went_missing:

What could be causing this issue?

解决方案

When you increase the number of items in a loop, did you observe any increase in CPU or memory perspective in Availability and Performance section. You can check this by following the below steps.

From the Portal, Go to Function App àPlatform features àDiagnose and solve problemsàAvailability and Performance

It might be the possibility that Function app is hitting some threshold values, due to which you are observing some weird behaviors.

Currently the maximum available memory of the Function App is 1.5 GB on the consumption plan and while running on dedicated instance(Basic, Standard, Premium, and Isolated SKUs) it depends on the SKU on which function app is running.


这篇关于Python函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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