多个 https 请求..如何?
我有一个 https API URL,我需要运行多次,并尽快检查域的状态。
如何同时运行相同的 URL 多次,同时接收输出中的响应,并关闭已完成的连接,同时保持尽可能低的内存资源?
有人告诉我要在另一种语言(不是 PHP)中使用线程?
任何例子或伸出援手将不胜感激!谢谢
I have an https API URL which I need to run multiple times, and as quickly as possible to check the status of a domain.
How can I run the same URL multiple times concurrently, while receiving the response in output, and closing the finished connection, whilst also keeping memory resources as low as possible?
I was told to use threading in another language (not PHP)?
Any examples or lending hand would be greatly appreciated! Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
刚刚快速谷歌了一下,得到了这个 ,我相信这会解决您的问题 - 这句话总结了这一点:
Just did a quick google and came up with this, I believe this will solve your problem - this quote sums it up:
m.edmondson 比我快 :D
一个可能有用的信息:当同时使用curl 执行大量请求时,您可能会出现时间滞后,因为curl DNS 解析器不能同时工作。
作为另一种想法,您可以编写一个 php cli 脚本,该脚本分叉单独工作的孩子,或者只使用 bash 和 bash 。 lynx(在 Linux 上)。
m.edmondson was faster than me :D
An maybe helpful information: When doing a lot requests with curl simultaniously, you'll probably get a time lag bcs the curl DNS resolver doesn't work concurrently.
As an alternative idea you could write an php cli script which forks childs who work seperately, or just use bash & lynx (on linux).