目前,我在使用CF10的CFHTTP时遇到很多麻烦。
首先,我的测试脚本:
<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调用,它们花费的时间被推送到一个数组中;就这样。
CF9服务器的结果:
CF10服务器的结果:
CF10服务器的结果,两次CFHTTP调用之间有5秒的延迟:
我已经在论坛和Shilpi的博客上阅读过,原因可能是Linux服务器用尽了熵。我watch --interval=0.1 cat ...
在测试脚本运行时检查了,但是它从未下降到4k以下(已经安装了rngd)。
有人有其他想法我可以尝试解决此问题吗? Using /dev/urandom seems to be an insecure hack to me; so that's not an option (since CF10 server is production machine).
Thanks guys!
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.
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.
Source: http://blogs.coldfusion.com/post.cfm/optimizing-cfhttp-calls-on-linux-systems
Solution: Add “-Djava.security.egd=file:/dev/./urandom”
to your jvm-setting.
在Adobe论坛中,您发现了另一个有问题和相同解决方案的线程,以及以下链接以及有关随机数生成器的更多信息:http : //forums.adobe.com/thread/1063806
无需使用/ dev / urandom即可,因为它是一种安全的解决方案:https : //security.stackexchange.com/a/3939
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句