Increasing Apache load handling capacity

We have a PHP/MYSQL based intranet based product which runs in XAMPP on a LAN. At any given point of time there are more than 30 to 35 clients connected to the application and request information every second using JSON. What happens is during the peak hours the apache stops responding and the system hangs , at times apache also stops automatically and we have to start the apache or start the full server machine. I believe this is happening as apache is not able to handle the large number of requests coming at once.

Can anyone advise what can be the reason of the above issue and what configuration should be changed in order to enable apache to handle more requests and work in more stable and robust mechanism.

Apache should be able to handle more requests than that per second.

If this is an actual web server, I would remove XAMPP right away as that is only meant to be used to easily setup a development area.

Install Apache (you can also strongly consider IIS since your on windows), with only the modules you need enabled. Same with PHP, install it only with the modules you need. For MySQL tune it according to what table type you are using.

If your still not able to handle more requests, you really need to take a look at your actual code and why it become a bottleneck. I.e. why does it take so long to process the code per request. Look for file locks, database table locks etc. Anything that can tie up multiple requests at once.

If you’re having a lot of clients requesting data every second (!) it might well be worth it looking into either long polling or, even better, websockets instead.

Depends on the data and what you are serving – long polling and web sockets can help in some instances but they can actually hurt in others. Presuming your app is responsive enough you can serve a pretty insane number of HTTP GET requests before getting into easy tricks like caching reverse proxies. Whereas with long polling and web sockets you are basically holding a connection open for the length of the session and each of those connections is ram and processes on the server. You will hit a wall alot quicker there than serving loads of GET requests.

FWIW, I would also start by using a production-configured stack to serve this rather than XAMPP. I would also look at how long each request takes to service and if polling every second is the right thing here.