1

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!

2 Answers2

1

Use Apache Bench (ab).

Here's a random example and another.

RedGrittyBrick
  • 3,792
  • 1
  • 16
  • 21
1

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).

symcbean
  • 19,931
  • 1
  • 29
  • 49
  • 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. –  Nov 03 '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 09 '12 at 16:25