本文介绍了CFHTTP:第一次请求快,后面慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在对CF10的CFHTTP有很多麻烦。

I'm having a lot of trouble with CF10's CFHTTP at the moment.

首先,我的测试脚本:

<CFSET results = arraynew(1) />
<CFLOOP from="1" to="10" index="idx">
    <CFSET timer_start = getTickCount() />
    <CFHTTP url="https://www.google.de" method="get" result="test" />
    <CFSET arrayappend(results, (getTickCount()-timer_start)/1000 & " s") />
</CFLOOP>
<CFDUMP var="#results#" />

10个CFHTTP调用连续,

10 CFHTTP calls in a row, the time they take gets pushed to an array; that's all.

我们的CF9服务器的结果:

Results of our CF9 server:

我们的CF10服务器的结果:

Results of our CF10 server:

CFHTTP调用之间延迟5秒的CF10服务器的结果:

Results of our CF10 server with 5 sec delay between CFHTTP calls:

我已经阅读了 and ,原因可能是Linux服务器耗尽熵。我检查与 watch --interval = 0.1 cat ... ,而我的测试脚本运行,但从来没有下降远低于4k(已安装)。

I already read on the forum and Shilpi's Blog that the reason could be that the Linux server runs out of entropy. I checked that with watch --interval=0.1 cat ... while my test script ran but it never dropped far under 4k (with rngd already installed).

有没有人有另一个想法,我可以尝试解决这个问题?

Does anybody has another idea what I could try to fix this problem?

谢谢你们!

推荐答案

在linux系统(主要是刚安装的系统)的情况下,观察到这个操作可能相当耗时,因为系统熵显然相当低。因此,因此,cfhttp调用会很慢。

In case of linux systems (mainly the ones which are freshly installed) it is observed that this operation can be quite time consuming because the system "entropy" is apparently quite low. Hence, as a consequence cfhttp calls will be slow.

资料来源:

In the Adobe Forums, you find another thread with your problem and the same solution and a following link with further informations about the random number generator:http://forums.adobe.com/thread/1063806

没有必要不使用/ dev / urandom,因为它是一个安全的解决方案:

There is no need for not using /dev/urandom as it is a secure solution: http://security.stackexchange.com/a/3939

这篇关于CFHTTP:第一次请求快,后面慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-25 09:52