Answer the question
In order to leave comments, you need to log in
WordPress get_num_queries() averages 100 queries for the main page, is that a lot?
Good afternoon!
I built several sites on WP in conjunction with ACF
using the code
<?php
echo 'WordPress: '
. round(memory_get_usage()/1024/1024, 2) . 'MB '
.' | MySQL:' . get_num_queries() . ' | ';
timer_stop(1);
echo 'sec';
?>
Answer the question
In order to leave comments, you need to log in
1. ~100 is not a little, and not a lot. Quite a working value, especially for WP + ACF (in this case, it’s even rather small).
2. The amount of memory used is very normal.
3. Execution time 200ms is normal. Not great, but quite normal. After all, we are talking about the execution of everything, and not just queries to the database. Now, if only these 100 queries in the database were executed so much, then this is already sadness.
Optional:
4. Use the Query Monitor plugin for detailed statistics, including the time of executing queries to the database.
5. Use object cache (memcached / redis on the server + plugin for WordPress), both WP itself and ACF add database queries there, which noticeably speeds up the work.
No :) You need to know the hosting parameters + settings for nginx/apache, php, mysql, the same memcached/redis (if any). And the OS itself on the server, to be honest. I/O, open file limits, descriptor caches, even TCP Congestion Control can make a huge difference.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question