skip to Main Content

In phpMyAdmin > status you can monitor this charts (see image below), what is questions? And what rate is it, per second, per minute or? If its per second its very high for even a simple php script with three select and three insert commands. Cant understand how it can be ~1k questions in one second for this type of script when i try it with 3 users.

enter image description here

2

Answers


  1. In MySQL, as observed from phpMyAdmin’s status, "Questions" denotes the total number of queries the server has processed since startup. This includes all types of queries, not just SELECT commands.

    The rate typically associated with this is "Queries per second" (QPS). For a basic script, a QPS of ~1k does appear high. Here are potential reasons for such a high QPS:

    Caching: Ensure MySQL’s Query Cache is active and effective.
    Loops: Your script might be executing queries inside unintended loops.
    Connection Overhead: Repeatedly connecting to the database can increase overhead, as background setup queries are executed each time.
    Other Scripts/Users: External scripts or users might also be accessing the database concurrently.
    Background Operations: MySQL’s internal tasks, including replication or maintenance, could contribute to the query count.

    Login or Signup to reply.
  2. Questions are the total number of statements executed by the server. This includes statements executed within stored programs.

    In phpMyAdmin, the charts generally show queries per second as the rate. This means if you see a value of 1000, it represents 1000 queries (or questions) executed against the server in one second.

    So when you see 1000 queries for just one second in simple script, there might be a few reasons:

    1. Do you use ORM? (it could run a lot of queries on background)
    2. Do you have any background jobs or other processes?
    3. Are you sure that there is no other scripts connected?
    4. Caching?

    Without any code I couldn’t provide more information.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search