Archive for July, 2009

SBDavid

MySQLTuner

Installation and Requirements:

The script is a basic Perl script that has no additional requirements. At this time, MySQLTuner is compatible with Linux/Unix based operating systems with Perl 5.6 or later. MySQL versions 3.23 and later are supported by the script.

To get started, simply download MySQLTuner and make it executable:

# wget http://mysqltuner.com/mysqltuner.pl
# chmod +x mysqltuner.pl
# ./mysqltuner.pl
SBDavid

Resolving high MySQL memory usage.

On RHEL uses a memory efficient /etc/my.cnf file. If you install MySQL on a Debian server, edit the key_buffer_size setting in /etc/mysql/my.cnf. A small value like 2M often works well. For an ultra-tiny setup add or change the follow entries to the mysqld section:

# if your are not using the innodb table manager, then just skip it to save some memory
#skip-innodb
innodb_buffer_pool_size = 16k
key_buffer_size = 16k
myisam_sort_buffer_size = 16k
query_cache_size = 1M

Find If Processor CPU is 64 bit or 32 bit

Try this to find out if your CPU/Processor is 32 bit or 64 bit

~$ getconf LONG_BIT
32

NAME
getconf - Query system configuration variables

SYNOPSIS
getconf [-v specification] system_var

getconf [-v specification] path_var pathname

DESCRIPTION
-v

Indicate the specification and version for which to obtain
configuration variables.

system_var

A system configuration variable, as defined by sysconf(3) or
confstr(3).

path_var

A system configuration variable as defined by pathconf(3). This
must be used with a pathname.

SBDavid

SAR or Sysstat

SAR or Sysstat

You can follow the below steps to install Sysstat Utilities which includes the “sar” command that is used to display your load average for the day.

1. Login to your server through SSH and login as root or su to the root user.

2. First just create a directory, or use one that you use to download temporary files.

cd /root/download

3. Download the rpm.

wget ftp.ibiblio.org/pub/linux/system/status/sysstat-5.0.2-1.i386.rpm

4. Install the rpm.

rpm -ivh sysstat-5.0.2-1.i386.rpm

5. You can set cronjobs for systat

cd /etc/cron.d
vi sysstat

Paste the following contents in it for recording load averages every 10 minutes.

# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib/sa/sa2 -A

Save the file and exit vi.

chmod 755 sysstat

6. To look at your load averages. Type in:

sar

Or

sar -q

This produces a better layout. It will show the loads recorded every ten minutes since midnight the night before. And then it will show your day’s average at the very bottom.

Mount windows drive to linux filesystem

Step 1: Take a Linux system. Install samba in your Linux system and start the service.

Step 2: Create a directory in Linux to which you will be mounting the files. Usually a subdirectory in “/mnt”

Step 3: Goto windows system. Share the drive/folder in windows system which you want to mount to Linux. Make sure that the drive/folder you are going to share is having the share permission for administrator.

Step 4: Go back to Linux system. Type the following command,

mount -t smbfs -o username=,password=,debug=4 //windowsservername or ip/drive or folder share name /mnt/share
Example:
mount -t smbfs -o username=administrator,password=gold,debug=4 //192.168.0.1/ewin$ /mnt/windrive

Step 5: Go to the directory you have made in Linux for mounting. Now you can see all the contents in windows drive/folder in that directory.

Next »