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.

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

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?