How to test max queries

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

I run the below script and when I look at the number of SQL queries being executed in MySQL Administrator, it shows ~900 (traffic 380-400k, usage 3%). The load average on the server goes to 1.10 (everything is on one server). Is that a decent method of figuring out how many queries per second the server can handle? Is there a way to figure out how many users the server can handle without having a bunch of people going to the website at the same time? Any bot programs you know about?

<?php
$x
= 1;
while(
$x > 0)
{
   
$sql = \"SELECT CourseSection.CourseID, Section.SectionID, Section.Type, CourseSection.OrderID, Section.Name, Section.Description, Count(SectionQuestion.QuestionID) AS CountOfQuestionID
            FROM (CourseSection INNER JOIN Section ON CourseSection.SectionID = Section.SectionID) INNER JOIN SectionQuestion ON Section.SectionID = SectionQuestion.SectionID
            WHERE CourseID =
$x AND Section.Type='L'
            GROUP BY CourseSection.CourseID, Section.SectionID, Section.Type, CourseSection.OrderID, Section.Name, Section.Description;\";
   
   
$result = mysql_query($sql);
   
   
$hi = mysql_fetch_assoc($result);
   
$x++;
}
?>