Ajax ping 脚本多个IP

发布于 2024-12-11 01:24:51 字数 155 浏览 0 评论 0原文

我有一个显示 IP 地址列表状态的页面。 它使用 ajax 为每个 IP 调用 ping 脚本。

我发现它一次只能执行大约 6 个操作,即使 javascript 同时请求所有 IP(大约 30 个)。

我怎样才能让它们同时 ping 通?

谢谢。

I have a page that shows the status of a list of IP addresses.
It uses ajax to call a ping script for each IP.

What I am finding is that it can only do about 6 at a time even though ALL of the IP's (about 30 of them) are requested at the same time from the javascript.

How can I get them to all ping at once?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你好,陌生人 2024-12-18 01:24:51

您的 Web 服务器似乎未接受超过 6 个请求,您应该检查一下。
此外,您可以使用 Firebug 查看是否所有请求都已同时触发以及每个请求发生了什么。

It looks like your Web Server is not accepting more than 6 requests, you should check it.
Additionally, you could use Firebug to see if all the requests have been triggered in the same time and what is happening with each of them.

長街聽風 2024-12-18 01:24:51

您可以发送的并发请求数量是有限制的。另请参阅此处: 有多少个并发 AJAX (XmlHttpRequest )在流行的浏览器中允许请求吗?

网站用来提高服务速度的一个技巧是限制所需的请求量。他们还将内容(图像)放入单独的(子)域中,因为您会在该域上收到另外 3 个(或 6 个)请求。

根据您的情况,您可以尝试将它们放入 1 个调用中,或将它们定向到多个子域。

(需要明确的是:虽然服务器可以有限制,但您在这里达到的限制是您的浏览器发出的请求。在 IE 中,您似乎可以被限制为另一个(2?)数字,请参阅我提供的链接)

There is a limit on how many concurrent requests you can send out. Also see here: How many concurrent AJAX (XmlHttpRequest) requests are allowed in popular browsers?

One trick websites use to make their serving faster, is to limit the amount of requests needed. They also put stuff (images) in a a separate (sub)domain, because you get another 3 (or 6) requests on that domain.

In your case you can try to fit them into 1 call, or direct them to several subdomains.

(to be clear: although the server CAN have a limit, the limit you are reaching here is the requests your browser sends out. in IE it seems you can be limited to another (2?) number, see the link I provided)

流心雨 2024-12-18 01:24:51

你只能做 6 个...需要太长时间吗?

You can do only 6...does it take too long?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文