configure server to handle a lot of requests
Solution 1:
Wow - what can I say, this stuff isn't easy is it? but have no fear, nobody is born just knowing this stuff so don't feel bad about it, well not yet anyway.
Ultimately this comes down to three main areas;
- Knowing your likely target audience - this is looking at what the max/ave/min number of users you're likely to see over a given day/week/month is. It's predominantly a task for your marketing people but you also need to understand the typical load than an average user is going to place on your environment. As an example you may be able to deduce that you might see 1000 x 100KB views per minute during 0900-1700 hours dropping to 100 per minute outside that time or similar.
- Designing the system - this is the actual designing of an end-to-end environment to support these requirements. Firstly you need to understand the data flow and volume of each of these average user interactions, firstly on your web services, then on your applications, then on your databases and then back the other way - generally you end up mapping out the workflow in a 'story' showing what actually happens for each user. Once you understand the nature of each user interaction you can create a Proof Of Concept environment to figure out how much CPU, memory, disk IO, disk capacity and network IO each typical user interaction will require. Once you have proved these technical requirements you can extrapolate the load requirements by the expected loads and begin the design of your production environment scaled to the correct levels for each of these resources.
- Build, test and tune the environment - this is where you'll actually create the various tiers/applications that you'll go into production with. There will be lots of differing skills, from scaling design to networking, OS management, application creation, storage management, security auditing, testing and eventually in-life support.
The great thing though is if you carry out these steps you'll end up with a platform that will perform according to requirements!
Solution 2:
There are two main things that determine how much traffic a server can handle:
- Server Power -- Obviously a bigger server means more serving capacity. A VPS will likely be on the "low" end of the serving scale.
- Content Type -- What you are serving has a significant impact on how much you can serve. You can server orders of magnitude more static 1kb images than you can a complex and unoptimized PHP/MySQL application.
Similarly, if you want a "faster" web site there are two main things you can do. You can get a better server (either a bigger one and/or more of them) or you can optimize your application (PHP op-code cache, optimized settings, caching layers, etc...). The former is generally easy to do but expensive while the latter can be much harder but get you farther in the long run. Be warned that a poorly designed application can bring even a huge server down.
What you do now really depends on your situation. In some cases it can be better to spend the money and upgrade to an over-speced server and then worry about proper application optimization later.