CFHTTP:第一次请求快,后面慢 [英] CFHTTP: first request fast, following slow

查看:413
本文介绍了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:

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

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).

有没有人有另一个想法,我可以尝试解决这个问题? 使用/ dev / urandom似乎是对我不安全的黑客;所以这不是一个选项(因为CF10服务器是生产机器)。

Does anybody has another idea what I could try to fix this problem? Using /dev/urandom seems to be an insecure hack to me; so that's not an option (since CF10 server is production machine).

谢谢你们!

推荐答案


在对cryfusion服务器进行cfhttp调用时,apache httpclient库会尝试生成安全的随机数。这是一个取决于系统的熵的操作。

While making a cfhttp call to a coldfusion server the apache httpclient library tries to generate a secure random number. It is an operation which depends on the "entropy" of the system.

在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.

资料来源: http://blogs.coldfusion.com/post.cfm/optimizing-cfhttp-calls-on-linux-systems a>

解决方案:添加 - Djava.security.egd = file:/ dev /./ urandom到你的jvm设置。

Solution: Add "-Djava.security.egd=file:/dev/./urandom" to your jvm-setting.

在Adobe论坛中,您发现另一个线程与您的问题和相同的解决方案和以下链接有关随机数生成器的进一步信息:
http://forums.adobe.com/thread/1063806

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,因为它是一个安全的解决方案: http ://security.stackexchange.com/a/3939

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

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

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