backbone-php Restful Parallel

Source: Internet
Author: User

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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.