Welcome Guest, Not a member yet? Register   Sign In
How do I make sure my application won't slow down under high usage?
#1

[eluser]KeyStroke[/eluser]
I'm making a site that's predicted to have high user usage (lots of processing and queries).

What I want to know is, how can I tell whether my application will slow down (or even break) under high usage or not?
#2

[eluser]gtech[/eluser]
create some automated tests?

I have a subdirectory called automated tests in my models and that will test every model function by calling it repeatedly for every scenareo.. this is time consuming but well worth while.. for load testing I have a set of controllers that will call these automated tests.

I also know there are utilities out there that plug into your browser and can record which requests you make, meaning you can save it and play it back on multiple machines.. not only that if you record a request to a controller that calls a set of automated tests you could actually put some timing information there.

just some ideas off the top of my head.. sure there are other approaches.
#3

[eluser]KeyStroke[/eluser]
But how do simulate high usage exactly through your code? and how do you know whether the time your code tikes to process is too long or just the necessary time to finish the work?
#4

[eluser]TheFuzzy0ne[/eluser]
[quote author="KeyStroke" date="1209404069"]But how do simulate high usage exactly through your code? and how do you know whether the time your code tikes to process is too long or just the necessary time to finish the work?[/quote]

Every server in the world will slow down if enough requests are being made at the same time. It depends how busy your expect your server to get. Personally, I would probably make is log benchmarks in a way that makes sense to you, and then you can check out the data for a busy period. That's probably the best way to test it to be honest.

EDIT: If your application is slowing down during busy times, it could be time to look into getting a new server/host or something with load balancing.
#5

[eluser]Sean Murphy[/eluser]
KeyStroke, good question. I suggest checking out this thread: Load Testing

ApacheBench (ab) is one of the more popular, and easier to use, utilities out there for load testing. You can use it on any web server but it comes bundled with Apache. There are plenty of tutorials on the net on how to use these tools. One I found in a quick search is here: http://www.mactech.com/articles/mactech/...index.html

If you are using MySQL I recommend turning on the slow query log before running your benchmarks/load testing, and then check the log afterward. If you see that queries were added to the log you'll likely want to optimize them before launching your app.
#6

[eluser]TheFuzzy0ne[/eluser]
Great advice. Thanks. (even though I'm not the OP)
#7

[eluser]gungbao[/eluser]
just some more ideas:

- use apache2, read howto slim down apache2
- use php5
- use php5 as apache_2 module
- use opcode caching - "phpa" is easy to install
- use CI caching an fragment-caching
- optimise your linux kernels file-system setup
- throw out content-thieves
- use mysql 4.1 not mysql 5.x
- read
Elliot

cache as cache can Wink




Theme © iAndrew 2016 - Forum software by © MyBB