Show database queries total, memory usage & execution time (WordPress)

It is a platform that no longer needs comments. As far as it is WordPressthe flexible, so much can request a lot of resources CPU / RAM If excess of plugins or of functions.

For blogs and sites created on WordPress to support an traffic great users, it is very important as page, functions and plugins to be optimized. Before we start optimizing we need to see cata memory It is necessary to access each page of the site / blog, which is the number of queries at the database (database queries) and the time when they are executed (execution time).

Show database queries total, memory usage & execution time (WordPress)

Show database queries total, memory usage & execution time.

To obtain a status We must insert the three lines below in footerthe theme (in the source – footer.).

Loaded in <?php timer_stop(1); ?> seconds.

Queries Executed <?php echo get_num_queries(); ?>.

Peak memory usage <?php echo round((memory_get_peak_usage()/1024)); ?> KB.

The less there will be any queries at the database (mysql), the less memory will be consumed, and the loading time will be lower. That means lower costs to pay services of and a better optimization (SEO) for search engines. Especially for Google, which emphasizes a lot of the loading time of the pages.

Founder and editor Stealth Settings, din 2006 pana in prezent. Experienta pe sistemele de operare Linux (in special CentOS), Mac OS X , Windows XP > Windows 10 si WordPress (CMS).

Home Your source of IT tutorials, useful tips and news. Show database queries total, memory usage & execution time (WordPress)
Leave a Comment