Monday May 20, 2024 - 12:00:18 PM

Registered Linux User #440901    

Login    Register
Login Required

Performance Tuning MySQL Database Server

After you have MySQL Server up and running, some time should be set aside for tuning and performance analysis.
You may want to see Getting MySQL up and running if you haven't seen it yet.

Howto performance tune MySQL on Ubuntu or a Debian based machine.

Do these commands as an administrative user. Most of this will be done in command line with your favorite terminal - like gnome terminal or Eterm.

First: Connecting to MySQL

Open a terminal. Let's connect and see what kind of variables we're dealing with:

mysql --user=root --password=YOURMYSQLPASSWORD
You should get:
mysql >
Put in:
Returned will be all of the variables. You may want to remember this last command. In the future when you are looking at someone's server. It's a quick way to get started on troubleshooting or tuning.
Note: If you get stuck by typing in the wrong thing and have just "->" or for some other reason need to clear the buffer, type \c (W/O quotes) and hit enter.
Note2: To get out and return to the terminal, just type "exit" (W/O quotes).
You can also use mysqladmin. These commands are a quick in and out of mysql. They run the command and return to the terminal.
mysqladmin variables -u root -p
mysqladmin extended-status -u root -p

A quick and dirty/simple report using mysqladmin:

mysqladmin extended-status -u root -p > /home/YOURDIRECTORY/mysqlxs.txt

Go to where you put it and have a look. (or just to make sure it's there: cat /home/YOURDIRECTORY/mysqlxs.txt)

Just like anything else, the more memory you throw at something, the better.

MySQL is very efficient and scalable and can actually run on very little memory. That said, it may need more memory allocated as tables start filling up and/or concurrant connection rates rise.
When tuning a MySQL server, the two most important variables to configure are key_buffer_size and table_cache. (More detail later on these.) You should first feel confident that you have these set appropriately before trying to change any other variables.
These examples show some typical variable values for different configurations:

More Coming Soon:

Have Fun!

Help Keep Us Online  

Time since last reboot: 12 days, 23 hours, 5 minutes , 3 seconds

@ Active Member Project Honeypot  email addresses

This page was last modified on 12/19/18 @ 09:26:37:pm
This file name: tuningmysql.php

Questions, Comments, Suggestions or Requests should be sent to: 

There have been  32197  Unique Visitors (IP Addresses) to this site.

Current users online : 18
Maximum users at a time : 60
Last 25 attacks have come from:

There are currently 25 unique IP addresses blacklisted.

Public Server Status
server online dbc001  db cluster service
 Is On-Line
server online www03  web service
 Is On-Line
server online www  web service
 Is On-Line
server online mx 08  mail service
 Is On-Line
server online www ha  F/O web service
 Is On-Line
server online mx 11  mail service
 Is On-Line
server online Primary  Client DNS
 Is On-Line
server online Secondary  Client DNS
 Is On-Line

©Copyright 2004-2024 - - Redd Enterprises™, Inc.,  All Rights Reserved.
Ubuntu® is a registered trademark of Canonical Ltd.
Linux® is a registered trademark of Linus Torvalds.
Apache® is a registered trademark of The Apache Software Foundation.
PHP® is a registered trademark of The PHP Group.
The MariaDB® a registered trademark of the MariaDB Corporation Ab.
MySQL® is a registered trademark of the Oracle Corporation Inc.
All other product and service names mentioned are the trademarks of their respective companies.


Let us know what you think!