Have you tried MySQLTuner yet? It's free and it makes optimizing your MySQL server easier than ever!

Archive for October, 2007

If you want to convert a MyISAM table to InnoDB, the process is fairly easy, but you can do something extra to speed things up. Before converting the table, adjust its order so that the primary key column is in order:

ALTER TABLE tablename ORDER BY 'primary_key_column';

This will pre-arrange the table so that it can be converted quickly without a lot of re-arranging required in MySQL. Then, simply change the table engine:

ALTER TABLE tablename ENGINE = INNODB;

If your table is large, then it may take a while to convert it over. There will probably be a fair amount of CPU usage and disk I/O in the process.

These statements are also safe in replicated environments. When you issue this statement to the master, it will begin the conversion process. Once it is complete on the master, the statement will roll down to the slaves, and they will begin the conversion as well. Keep in mind, however, that this can greatly reduce the performance of your configuration in the process.

Special thanks to Matthew Montgomery for the ORDER BY recommendation.

Comments 2 Comments »

Yet another weird Plesk error with terrible grammar popped up on a server that I worked with this week:

Error: There is incorrect combination of resource records in the zone

As you can see, this error is not terribly informative. Here’s a little background on what I was doing before this alert appeared:

On Plesk 8.1.1, I needed to create an alias for a certain domain. Each time I’d try to create the alias, I’d receive the above error. I could even try junk domains like ‘test.com’ and it would still fail with the error. I went to a different domain on the server, tried to add an alias there, and it failed as well. So, I went back to analyze the error further.

The only thing that tipped me off was the zone word, and I immediately began thinking of DNS. I checked the DNS configuration for a few of the domains, and they appeared to be pretty standard. There weren’t any wild DNS records, and there were no problems with the named configuration nor the zone files themselves. I crawled through the dns_recs table in the psa database, and everything appears to be normal.

I admitted defeat and escalated the issue to SWSoft to get their help. The answer came back, and I was dumbfounded.

Apparently this record was present in the DNS configuration for all of the sites on the server:

mail.domain.com. CNAME domain.com.

This DNS record prevented Plesk from making an alias. Just this DNS record. In short, Plesk was unable to make the alias because of this lonely CNAME. The SWSoft developers claimed that it is an ‘old-style’ notation and that it ’should not be used’. However, during upgrades from 7.x to 8.x, they never thought it’d be a good idea to check for this record and fix it accordingly.

Basically, the SWSoft developers recommended changing the DNS record manually for each domain to something like this:

mail.domain.com. A 111.222.333.444

I did that, and it worked flawlessly. Even though this fixes the issue, I still think that they should have considered this issue during the upgrade routines.

Comments No Comments »

Normally, this error will pop up when you attempt to restart a Plesk-related service, like httpsd, psa-spamassassin or qmail:

Error: HTTPD_INCLUDE_D not defined

This basically means that Plesk is unable to get some required configuration directives from the /etc/psa/psa.conf file. If you can’t find the directive in the file that Plesk is complaining about, check your Plesk RPM’s with rpm:

# rpm -q psa

Most likely, you will find that there is a psa-7.5.4 RPM and a psa-8.1.0 or psa-8.1.1 RPM installed simultaneously. This generally appears because of a botched upgrade that was started within Plesk by the admin user.

To fix the issue, get the psa-7.5.4 RPM from autoinstall.plesk.com. Remove the psa-8.1.1 RPM and install the psa-7.5.4 RPM again rather forcefully:

# rpm -ev psa-8.1.1...
# rpm -Uvh --force --nodeps psa-7.5.4...
# /etc/init.d/psa restart

At this point, you can download the command line autoinstaller and try the Plesk upgrade again.

Further reading: http://forum.swsoft.com/showthread.php?threadid=32299

Comments No Comments »