cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution
New

PHP POST calls makes website unresponsive

Hi everyone

 

I have a website on an ultimate hosting plan using cpanel/linux. I am building a game on javascript and I frequently have to store the player's position/score/moves on the server, which I do using PHP-POST storing everything on a mySQL database.

 

It all works well most of the time, but after about 150 or so POST calls, the website is then unresponsive - the next POST call gets no response (no errors, nothing), and even trying to refresh the website gets no responses - so once triggered, the block goes beyond POST calls. It takes around 2-3 minutes to respond again.

If I turn on a VPN, it works again - for a while, and then it becomes unresponsive again after 150 or so calls, so it looks like the error is linked to each IP address -- is there a limit on POST calls from each IP address? How can I solve this?

 

Many thanks!

Leo

1 ACCEPTED SOLUTION
Helper VI

There are many reason why a site does not respond.

  • Open up your terminal and ssh into your server.
  • Use the command top or htop to display all of the process currently running on your server.
  • Do the post request and watch what happen to top or htop.  
  • Is the RAM usage filling up?
  • Is the CPU usage staying high?
  • Is apache spwning to many processes?
  • Nothing happens?
  • Which process is always on top? apache? phpfpm? mysql? for how long?

 

If you plan on making a multi player game, I recommend using a high concurrency server-side language like nodejs

 

 

 

~Jan Mykhail Hasselbring Web Administrator @ fullstackwebsolution.com

View solution in original post

1 REPLY 1
Helper VI

There are many reason why a site does not respond.

  • Open up your terminal and ssh into your server.
  • Use the command top or htop to display all of the process currently running on your server.
  • Do the post request and watch what happen to top or htop.  
  • Is the RAM usage filling up?
  • Is the CPU usage staying high?
  • Is apache spwning to many processes?
  • Nothing happens?
  • Which process is always on top? apache? phpfpm? mysql? for how long?

 

If you plan on making a multi player game, I recommend using a high concurrency server-side language like nodejs

 

 

 

~Jan Mykhail Hasselbring Web Administrator @ fullstackwebsolution.com

View solution in original post