duanpie2834 2013-07-14 21:29
浏览 33
已采纳

可以改进SOAP请求的执行时间吗? [关闭]

I have a SOAP request I'm doing in PHP. It can take anywhere from 1-2 seconds to as much as 5 or more. This is on the slow side because the data is to be loaded and displayed on a web page. It can slow down the overall load time on the web page. I'm looking for ways to improve the performance of the SOAP request if that is feasible. I don't think it is practical to cache the data because the data is updated every minute. I have considered polling a SOAP request every minute and caching it, but to do that 24/7 might be considered hammer the 3rd-parties server.

This is in PHP in Linux. Would it improve the execution in a noticeable way if the SOAP request were done in another language such as C? Or it polling a SOAP request during expected heavy website traffic (such as the morning) every minute a better solution? Thanks!

  • 写回答

1条回答 默认 最新

  • douhu2370 2013-07-15 07:09
    关注

    Strategies depend on the amount of different calls you'd make.

    You cannot really improve the Soap execution time itself. You have to wait as long as the request takes.

    Is that request done for every user individually or is it always the same? Then caching for one minute will improve the situation in 55 of 60 seconds in every minute, assuming that one call takes 5 seconds, and any site request is served by that cache entry.

    This only can be improved if you really make one request to the Soap server per minute to fill the cache before any of your users require the data.

    On the other side, you can reduce fetching always uptodate data by making the cache entry last longer than one minute.

    A very sophisticated system would try to know in advance if the user MIGHT actually need the Soap data, and trigger that request and cache filling without impacting the user, for example by adding the request to a queue that is executed independently. It can then fill the cache, and at the time the Soap request is needed, the cache is filled.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大