Website backstage with Backbone write, Api with the PHP write Restful, make multiple requests at once will be very slow. How can i solve this problem?
Reply content:
Website backstage with Backbone write, Api with the PHP write Restful, make multiple requests at once will be very slow. How can i solve this problem?
According to your request time, basically can be judged to be caused by blocking.
There are two kinds of blocking: The browser is blocking the concurrent connections to the same domain name, and if this limit is exceeded, the browser is blocked for subsequent requests. This is one of the reasons why there is a dedicated static resource server, and the limit of connections is as follows (what does it mean to refer to the number of concurrent request resources allowed by the browser?). ):
From the point of view your connection number does not seem to exceed the maximum number of Chrome 4+ connections 6, so it may also be the server side of the problem, the server is more diversified, but the biggest reason is to share a resource, and this resource does not implement concurrency characteristics. May be a problem with your code, such as locking a file, for example, in the Nodejs main thread to handle synchronization, large-scale computation of the task, may also be improper server configuration: php-fpm (Unix) or php-fastcgi (Windows) Maximum only one instance is allowed to process requests frequently, and each request takes longer.
Ashamed to not actually solve the problem, but according to your description can not really know the root cause of the problem, it is recommended to ask the next question to provide a more detailed description of the problem. At the request point you should intercept the whole point the most important timeline actually didn't come in.