Backbone-phpRestful parallel

Source: Internet
Author: User
The website is written using Backbone in the background, and the Api uses php to write Restful. It will be very slow to send multiple requests at a time. How can this problem be solved?

The website is written using Backbone in the background, and the Api uses php to write Restful. It will be very slow to send multiple requests at a time. How can this problem be solved?

Reply content:

The website is written using Backbone in the background, and the Api uses php to write Restful. It will be very slow to send multiple requests at a time. How can this problem be solved?

Based on your request time, it can be basically determined that the request is blocked.

There are two types of blocking: client blocking: the browser has a limit on concurrent connections to the same domain name. If this limit is exceeded, then, the browser blocks subsequent requests. This is one of the reasons why there is a dedicated static resource server. The number of connections is limited as follows (reference the number of concurrent request resources allowed by the browser ?) :

From the point of view, the number of connections does not seem to exceed the Max number of connections in Chrome 4 + 6, so it may also be a problem on the server side. The server side is more diversified, but the biggest reason is that you share a single resource, this resource does not implement the concurrency feature. May be your code problems, such as locking to read a file, such as in the nodejs main thread to process synchronization, large computing tasks, may also be the server configuration improperly: PHP-FPM (unix) or PHP-FastCGI (windows) allows a maximum of one instance to process requests frequently, and each request takes a long time.

Sorry, the problem cannot be solved, but you cannot really understand the root cause of the problem according to your description. We recommend that you provide a more detailed description of the problem to be asked next time. At one point, you should take the most important timeline in the whole site and never 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.