Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I'm building a quite simple web application, and need to get some rough understanding of how much load my server can take.

Of course, this depends on a whole lot of factors, but I just need a rough idea if we're talking about ten or ten thousand users, because at the moment I have no idea.

Standard LAMP-setup, with a quite small database and a reasonably simple and fast PHP. Each non-static request requires about 20 simple SQL queries. With no load, the runtime for such a request is around 50 ms. No explicit caching.

Current hosting is on a VPS w/ 1GB RAM and unknown CPU.

Is it possible to give a rough estimate given this? What is the bottleneck? CPU, RAM? Does 50 ms / request mean 20 requests per second? How much can caching help (factor 10? 100? 1000?)? Where would caching make most sense? How do I perform load-testing?

Uuh, lots of questions, not expecting detailed replies but would greatly appreciate pointers to where I can go from here to read up on system requirements/testing/possible ways of scaling up!

share|improve this question

marked as duplicate by masegaloeh, Sven Apr 14 '15 at 16:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 1 down vote accepted

Number of users is pretty much irrelevant - the important thing is the number of hits and how quickly they are turned around. "quite small database" - this isn't really a very useful metric.

Current hosting

So you've already got it setup and running? Then you are in a far position than us to estimate capacity. Start recording %D in your apache logs (if you're not already doing so) and logging mysql slow queries with a threshold of 0.

Each non-static request requires about 20 simple SQL queries

erk! that's a lot of database round trips. Considered using joins (even cartesian joins for queries which return single rows can give a big performance boost) or server-side caching?

Does 50 ms / request mean 20 requests per second?

No - it might mean it can process 500 requests in 50ms, or it might mean that it can only process one request every 50ms.

Go read some of Steve Souder's stuff.

Limiting factor on your current system is probably memory (would your entire database and the files for the website fit into the memory available for caching? I suspect not).

share|improve this answer
Thanks a lot! Have implemented some pretty aggressive server-side caching, so DB roundtrips won't be the bottleneck. It will likely be memory, as you say. – user58163 Nov 3 '10 at 11:48
Do you have any references for the '20 queries is a lot' claim? I'm currently trying to optimise a Joomla-based site and 20 queries per page request would be nirvana ;-) – Bobby Jack Feb 9 '12 at 16:25

Use Apache Bench (ab).

Here's a random example and another.

share|improve this answer