SharePoint 2010 沙盒解决方案超时

发布于 2024-11-02 11:57:34 字数 102 浏览 1 评论 0原文

有没有办法调整 SharePoint 2010 沙箱解决方案的超时值?我认为默认为 30 秒。我有一个 Web 部件,有时运行时间会比这长一些。如果可以避免的话,我真的不想回到农场解决方案。

Is there a way to adjust the timeout value for a SharePoint 2010 sandbox solution? I think it defaults to 30 seconds. I have a web part that occasionally runs a little longer than that. I really would prefer not to fall back to a farm solution if I can avoid it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

很酷又爱笑 2024-11-09 11:57:34

查找有关此内容的文档有点困难,但我在此处找到了它。相关部分如下:

每个请求,请求受到惩罚:沙盒解决方案完成所需的时间存在硬性限制。默认情况下,该时间为 30 秒。如果沙盒解决方案超出限制,则处理该请求的应用程序域(但不是沙盒工作进程)将被终止。此限制是可配置的,但只能通过针对对象模型的自定义代码进行配置。沙盒解决方案无法访问对象模型的相关部分,因此任何沙盒解决方案都无法更改该限制。

CPU 执行时间 只要将此资源设置为高于“每个请求”(具有上述“请求惩罚”限制),该资源的绝对限制就不适用。通常,管理员希望将其保持在较高水平,以便在导致整个沙盒工作进程终止之前终止缓慢的请求,甚至包括其中运行的表现良好的沙盒解决方案。

以下代码可用于调整每个请求超时:

SPUserCodeService.Local.WorkerProcessExecutionTimeout = 40;
SPUserCodeService.Local.Update();

您应该能够通过如下方式调整 CPU 执行时间:

SPUserCodeService.Local.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit = 50.0;
SPUserCodeService.Local.Update();

您必须重新启动 Microsoft SharePoint Foundation 沙盒代码服务才能使更改生效。

Finding the documentation on this was a little difficult, but I found it here. The relevant parts are these:

Per Request, with the Request Penalized: There is a hard limit to how long a sandboxed solution can take to be completed. By default, this is 30 seconds. If a sandboxed solution exceeds the limit, the application domain that handles the request (but not the sandboxed worker process) is terminated. This limit is configurable, but only through custom code against the object model. The relevant parts of the object model cannot be accessed by sandboxed solutions, so no sandboxed solution can change the limit.

CPU Execution Time The absolute limit of this resource is not applicable as long as it is set higher than the Per Request, with the Request Penalized limit described above. Normally, administrators will want to keep it higher so that the slow request is terminated before it causes a termination of the whole sandboxed worker process, including even the well-behaved sandboxed solutions running in it.

The following code can be used to adjust Per Request timeout:

SPUserCodeService.Local.WorkerProcessExecutionTimeout = 40;
SPUserCodeService.Local.Update();

You should be able to adjust the CPU Execution Time with something like the following:

SPUserCodeService.Local.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit = 50.0;
SPUserCodeService.Local.Update();

You have to restart the Microsoft SharePoint Foundation Sandboxed Code Service for the changes to take effect.

软甜啾 2024-11-09 11:57:34

在 PowerShell 中,您可以使用以下命令调整超时:

$uc=[Microsoft.SharePoint.Administration.SPUserCodeService]::Local
$uc.WorkerProcessExecutionTimeout = 60
$uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit = 120
$uc.Update()

In PowerShell, you can adjust the timeouts using the following commands:

$uc=[Microsoft.SharePoint.Administration.SPUserCodeService]::Local
$uc.WorkerProcessExecutionTimeout = 60
$uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit = 120
$uc.Update()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文