简体   繁体   English

需要使用php发送异步url请求并知道所需的时间

[英]Need to send asynchronous url request using php and know, the time required

I have a database in the cloud, i need to know, at what time and the number of requests will the server crashes down, so I have thought of sending asynchronous requests using php and then find the time needed for serving each of it. 我在云中有一个数据库,我需要知道,在什么时间和服务器崩溃的请求数量,所以我想到使用PHP发送异步请求,然后找到服务它们所需的时间。 I am bit confused as in how to proceed, I am not sure, if cURL will be useful here. 我有点困惑,如何继续,我不确定,如果cURL在这里有用。 Just a layout of how to proceed will be helpful. 只是一个如何进行的布局将是有帮助的。

ab -n 1000 -c 10 http://yourserver.com/

-n number of requests -c concurrency -n请求数-c并发

There other tools to benchmark server 还有其他工具可以对服务器进

ab is a part of apache tools ab是apache工具的一部分

Use siege or Apache benchmark tool to load test your server by calling single or multiple urls, you can increase concurrency, volume of the requests to the server. 使用siegeApache基准测试工具通过调用单个或多个URL来加载测试服务器,可以增加对服务器的并发性和请求量。 siege will give you detail report of the requests and concurrency and how is your server performing, you even call your single server from multiple other servers. siege将为您提供请求和并发的详细报告以及您的服务器如何执行,您甚至可以从多个其他服务器调用您的单个服务器。

It means that server is heavly loaded with the request ie, all the threads are busy serving the request. 这意味着服务器负载大量请求,即所有线程都忙于为请求提供服务。 Solution : either increase the maxThread attribute count for connector in server.xml file or increase acceptCount attribute value. 解决方案:要么增加server.xml文件中连接器的maxThread属性计数,要么增加acceptCount属性值。

acceptcount : The maximum queue length for incoming connection requests when all possible request processing threads are in use. acceptcount:当所有可能的请求处理线程都在使用时传入连接请求的最大队列长度。 Any requests received when the queue is full will be refused. 队列已满时收到的任何请求都将被拒绝。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM