I read a lot about my problem. I have 4 years old WordPress (with newest 3.8.1 WordPress) site. And last months it become really slow. It takes about 3-5seconds to render page. In administration area is situtation more critical, there is 6-8seconds render time. MySQL queries are only 41 (when I disable all plugins) a it takes same time. But in frontend there is significant time reduction when I disable all plugins, but I want to use them. But there is almost no diffrence between 400+ queries (plugins on) and 60queries (plugins off). I use WP SUper Cache, which server pages really fast. But I want to debug my wordpress to see where exactly is the problem. I know that it might be a lot queries, but PHP works same time with 400queries and 60queries. So there must be some PHP bug, or something wrong.
I would like to have option to see what is taking so long to PHP, when it process all queries. Queries time is under 1second everytime with any amount of queries.
UPDATE:
Ok, I got an idea. Because I am not a well skilled in MySQL or PHP I can share Debug Objects querry list. Is that good idea, to help me sort out this problem?
You can use the plugin Debug Objects and his query function to identify the slowest queries from core and plugins. I see very often the problem on a plugin or theme functionality. Identify and solve.
SOLVED
I installed Query Monitor plugin, which showed me a number of queries and memory usage. Then I turned off one by one plugin to find which plugin consume most memory and how much will number of queries change.
I also discovered that number of queries didn’t change speed of page render. I have about 200 queries per page (admin area/frontend site) and it’s cause by theme Jarida. But when I switch to Twenty Eleven, there is only 20queries, but render time on server side is still almost same (some miliseconds changes).
So the main reason why my page is so slow, are those three plugins, which consume a lot of memory on server and have a heavy PHP code.
when these three plugins are activated page load rise from 1,2s to 2,8s on my localhost WAMP server, it’s even worse on my live site (using shared hosting service).
So If you want to use a lot of heavy plugins like these you have to switch to more powerfull webhosting service. For me is solution to switch to rooted (unmanaged) VPS, which provide me a lot of power to handle a heavy WordPress plugins like those above.
There is another partialy solution. I am now using temporary WP Super Cache, which is serving all pages as .html files (so there is no need to process PHP code and no database queries). It works fine and really fast, but it’s only for frontend website, not for admin area. Admin area is still slow and it’s paing to use it.
I am also hitting with my current WordPress installation 128MB memory limit. In every render page my whole site consume about 100MB memory. So it’s really close to not work at all. Shared hosting is not ideal for a WordPress site with a lot of plugins. There is just not enough computer power to process all PHP code. So it takes up to 6seconds to render one page for one visitor.
If you’re seeing a time reduction when you disable plugins, you can use the P3 plugin to see which plugins are taking a lot of time to run.
You haven’t said how big your site is but if it’s a fairly large site using a lot of inserts/updates/deletes to the MySQL database, then it could be that your tables have built up a lot of overhead.
Optimizing the tables may help. This can be done within PhpMyAdmin.
Check out the following posts:
https://stackoverflow.com/questions/565997/in-mysql-what-does-overhead-mean-what-is-bad-about-it-and-how-to-fix-it
https://stackoverflow.com/questions/1288573/how-much-table-overhead-is-too-much
http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html