What kind of tests should I run to determine bottlenecks on my server? I'm trying to optimize so I can maintain heavy load spikes when they occur. I'm running Ubuntu in a LAMP environment.
I would recommend to first install a logging framework such as munin, so that you have a some data available on your base load and during the spikes on your server. Then, I would monitor the queries on your SQL server (especially the slow queries).
Using this information, you can already determine if how extraordinary these situations are or whether they simply add the last nail to a highly loaded machine and what happens, such as you are running out of RAM, certain processes are hammering the disk at times, or your CPU is the issue.
What I have found best is to perform a capacity analysis before deployment. However there is a really great article on exactly what you are looking for, I hope this helps.
1) Track MySQL Queries taking over a second 2) Monitor PHP Memory Usage & Log Apache Delivery Times 3) Log PHP Errors 4) Take Snapshots at an OS Level
I'd also like to add JMeter into this. http://jakarta.apache.org/jmeter/
This is a very broad question. To measure anything, first you need a baseline performance indicator. Install
Think about your application. Is it database-heavy? Lots of IO? CPU (video encoding)? Perform some normal web application tasks and see where your bottlenecks even exist, first. Use other tools like
After you have established some baseline metrics and breaking points, you can see where to improve. As stated, this is a broad question and therefore has a rather wide-spectrum answer:
Other points and considerations:
tl;dr Graph everything you think is relevant, hit your server hard, tune, repeat.