Minimizing server load in case of many XMLHttpRequest calls

Posted by user1888975 on Stack Overflow See other posts from Stack Overflow or by user1888975
Published on 2012-12-13T10:57:21Z Indexed on 2012/12/13 11:03 UTC
Read the original article Hit count: 154

Filed under:
|
|

I am making a website where users are to like some articles. Whenever the like button is clicked I am sending a XMLHttpRequest to the server to run a file called like_clicked.php along with the get data of article id and user id. This file takes article id and user id and updates the sql database and also adds a node in an xml file related to the user. This is the first time I am doing something for mass usage.

I am worried about the server load when too many users call the like_clicked.php file. Please help me, if this method is ok.

I am also thinking of an alternative in case the above method fails. I am thinking of making many like_clicked files (namely like_clicked1.php, like_clicked2.php ... ) to minimize load on a single i-node. Is there a method to detect that it is better to call the next like_clicked file. Here we would need to detect how many calls per unit time are coming for the particular file. How do we handle this?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript