3

I have a very simple server running WAMP on a Windows machine, with PHP code which is a simple API for my clients that returns XML. The things is that the hardware is very modest, and if a user calls the link to the API and hits F5 many times (calls the link repeatedly) the server performance goes down a little (response time goes up). Is there a way to limit the queries to port 80?

I know how to limit this in the the PHP code, but I think is not a good practice because even if I limit the queries on the PHP code the query is already made, and I'm consuming resources checking with PHP.

2
  • If your server is being brought to its knees by more than a couple of concurrent connections, I would advise taking a long look at your code and seek out opportunities to optimize (especially your database calls). Can you define "modest" hardware and also let us know which version of Windows you're on? Jul 8, 2010 at 0:57
  • In addition to what Justin stated, I would also suggest that you re-examine the hardware that the web site is running on. If it can't handle more than a few requests, something is lacking either in the code or the hardware.
    – joeqwerty
    Jul 8, 2010 at 2:34

1 Answer 1

3

That's a rather easy one.

Install the apache mod_limitipconn and setup a vhost for your domain. This will limit how many connections a user can have to that vhost.

Not the answer you're looking for? Browse other questions tagged .