douyan2002 2015-10-21 07:33
浏览 28

子域的增加是否有助于加快多个ajax结束?

I have a doubt regarding the multiple ajax calls.

Consider I have 100 ajax calls to make. If I used a single sub domain it is taking 30 sec to finish. But if I use 2 sub domains it is taking 20 secs & if I use 3 sub domains it is taking 18 secs.

All the Ajax calls are dynamic. The time to finish a call is a max of 3 sec. Each call need to communicate with db. Previously I had a single db for all the 3 sub-domains. Now I created 3 different databases.

My concern is to get them finished in 10 secs.

Any suggestions please.

KR

  • 写回答

2条回答 默认 最新

  • dongpiansui8755 2015-10-21 08:01
    关注

    The problem you're describing is the limit of simultaneous connections that browser opens per single hostname. If you have many calls to one server, some of them will need to wait before the others are finished (which causes delays). If you distribute resources between servers you get around this per-server-limit and they run simultaneously. However for small amount of data it is usually wiser to just merge requests together and send as one package, as otherwise you loose time for each request to get back and forth + repeating useless headers, opening connection.

    Check here for the current limits per browser. They might be nto strick implementing those limits, though. http://www.browserscope.org/?category=network

    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)