Logo Background RSS

» admin

  • MySQLTuner – High-performance MySQL tuning script
    By on October 28th, 2008 | No Comments Comments

    MySQLTuner is a script written in Perl that will assist you with your MySql configuration and make recommendations for increased performance and stability. Within seconds, it will display statistics about your MySQL installation and the areas where it can be improved.

    It’s key to remember that MySQLTuner is a script which can assist you with your server, but it is not the solution to a badly performing MySQL server. The best performance gains come from a thorough review of the queries sent to the server, and an evaluation of the MySQL server itself. A qualified developer in your application’s programming or scripting language should be able to work with a MySql Databasesadministrator to find improvements for your server. Once the server and application are optimized well, you may need to consider hardware upgrades to the physical server itself.

    This is a really useful tool for helping to optimize MySQL performance.Understanding the various my.cnf variables and how they affect performance can seem really complicated but this tool takes some of the pain away and makes it easier to understand the effects of each variable.It is especially useful to be able to see the global memory usage,  memory usage per thread and the maximum possible memory usage – that is really valuable information that is otherwise complex to calculate.

    MySQLTuner Features

    * Memory Usage: Calculates MySQL memory usage at max load and makes recommendations for  increasing or decreasing the MySQL memory footprint. Per-thread and server-wide buffer data is calculated
    separately for an accurate snapshot of the server’s configuration.
    * Slow Queries: Reviews the amount of slow queries relative to the total queries. Slow query time limits are also analyzed and recommendations are made.
    * Connections: Current and historical connection counts are reviewed.
    * Key Buffer: Takes configuration data and compares it to the actual indexes found in MyISAM tables. Key cache hit rates are calculated and variable adjustments are suggested.
    * Query Cache: Query cache hit rates and usage percentages are used to make recommendations for the query cache configuration variables.
    * Sorting & Joins: Per-thread buffers that affect sorts and joins are reviewed along with the statistics from the queries run against the server.
    * Temporary Tables: Variable recommendations are made to reduce temporary tables that are written to the disk.
    * Table Cache: Compares total tables opened to the currently open tables. Calculates the table cache hit rate in order to make suggestions.
    * Open Files: Determines if the server will approach or run into the open file limit set by the operating system or the MySQL server itself.
    * Table Locks: Finds table locking that forces queries to wait and makes suggestions for reducing locks that require a wait.
    * Thread Cache: Calculates how many times MySQL must create a new thread to respond to a query.
    * Aborted Connections: Finds applications that are not closing connections to MySQL properly.
    * Read/Write Ratios: Calculates the percentage of read and write operations on your MySQL installation.

    Install Mysqltuner in Ubuntu Intrepid

    sudo aptitude install mysqltuner

    Or using the following method

    Run MySQLTuner in Ubuntu

    Download MySQLTuner using the following command

    wget http://mysqltuner.com/mysqltuner.pl

    To run the script, simply make it executable and run it:

    chmod +x mysqltuner.pl

    sudo ./mysqltuner.pl

    Enter your administrative username and password

    You need to check mainly recommendations section at the end. It shows which variables you should adjust in the  section of your my.cnf (on Ubuntu file located at /etc/mysql/my.cnf).

  • What is the diff b/w GB and MB? Which holds more?
    By on October 6th, 2008 | No Comments Comments

    Hello friends do you know  gb(giga byte)  holds more or mb (MegaByte)

    1024 kb = 1 mb

    1024 mb = 1 gb

    So GB holds more :D

  • List Of Fifty Active RSS Directories
    By on October 6th, 2008 | No Comments Comments

    We have been discussing how important is RSS for a blog and what role it plays for a blog to become sucessful. Here is a list of 50 very good RSS directories.. I had to struggle a lot to get these for you had to go through lost of spammy directories which were not active and got these 50 from there :)

    Now its the time to enjoy :D

  • How To Optimize Your Meta Tags
    By on October 5th, 2008 | 1 Comment1 Comment Comments

    Meta tags are very important for the SE’s and the visitors coming to your website using search engines. So its very important to keep your Meta Tags optimized and people who have not yet included meta tags should do it right away.

    How to Optimize Your Meta Description

    Meta description helps visitors coming from search engine get a brief description about your blog, Meta description is very important if you want traffic from search engine..

    Here is an example of Meta Description

    1) <meta name=”DESCRIPTION” content=”Health Blog”>

    2) <meta name=”DESCRIPTION” content=” A Fitness, Diet and Health blog with hints and tips to help to live better”>

    Here the second one provides much more information about the blog so more visitors will flow towards it..

    Meta Keywords

    Meta keywords are another important thing which help you rank better in search engines, Using meta keywords you can specify your keywords to the search engine. Keywords should always be related to your niche.

    <meta name=”KEYWORDS” content=”Your Keyword list over here“>

    Example if you have health blog

    <meta name=”KEYWORDS” content=”health, nutrition, food“>

    Come’on start , Go! and optimize your meta tags.

  • Common SSH Commands
    By on September 17th, 2008 | 3 Comments3 Comments Comments

    This is a list of Common commands that can be run from root / SSH access.

    I. Basic Commands

    A. Retrieve Plesk Admin Password

    cat /etc/psa/.psa.shadow

    B. Change Directory (cd)

    cd /path/to/directory/

    C. Listing Files/SubFolders (ls)

    ls -alh

    (files and subfolders listed with perms in human-readable sizes)

    D. Checking Processes

    ps -a top -c

    (process viewer – Ctrl+C to exit)

    ps -auxf

    (process list)

    E. Start/Stop Services

    /etc/init.d/<service> start|stop|restart|status

    (“/etc/init.d/httpd stop” stops apache)

    F. Check Bean Counters (hard and soft limits, failcounts, etc.)

    cat /proc/user_beancounters

    II. File System Commands (df & du are (dv)-only commands)

    A. Check Total Disk Usage

    df

    (gives physical disk usage report with % used)

    B. List Files/Folders +Sizes (du)

    du

    (lists all filesizes. This will take some time.)

    du -sh

    (lists all the subfolders/sizes in a dir)

    C. Remove/Delete Files (rm /path/to/filename.htm) -DANGER- always verify

    rm -vf

    (force-deletes file. Dont run unless you know EXACTLY what you’re doing)

    rm -vrf

    (force deletes folder and all subfolders and files)

    To Remove a Directory you can use the following command:

     rmdir  

    D. Copy Files (cp)

    cp filename.abc /new/path/filename.abc.123
    

    E. Move Files (mv)

    mv filename.abc /new/path/filename.abc.123
    

    F. Create Empty File (touch)

    touch filename.123

    III. File Permissions and Ownership

    A. Change Permissions of files (chmod)

    chmod 000 filename.abc

    (defaults are usually 755 for folders, 644 for files)

    TIP:

    1st digit=Owner; 2nd=Group; 3rd=Other
    (-rwxrwxwrx = 777, -rwxr-xr-x = 755, -rw-r–r– = 644, etc.)
    7 = Read + Write + Execute
    6 = Read + Write
    5 = Read + Execute
    4 = Read
    3 = Write + Execute
    2 = Write
    1 = Execute
    0 = All access denied

    B. Change Ownership of files (chmown)

    chown user:group filename.abc

    (you can see user and group w/ ls -alh)

    TIP:

    Anytime a user creates a file, the Ownership of the file matches that user. In Plesk, every domain that has hosting has a different user. So if you are copying files from one domain to another, you must remember to change ownership.

    IV. Checking Log Files (dv)

    Log files can tell you a lot about whats going on on a (dv). You can use the command:
    ‘tail -n 100′ before the logfile name to list the last 100 entries of the logfile.

    Here are some of the most common:

    A. Main Error Log

    /var/log/messages

    B. Apache Error Log

    /var/log/httpd/error_log

    (main)

    /home/httpd/vhosts/mt-example.com/statistics/logs/error_log

    (per-domain) (May also be: /var/www/vhosts on newer dvs)

    C. MySQL Logs

    /var/log/MySQLd.log
    

    D. Mail Logs

    /usr/local/psa/var/log/maillog

    NOTE:

    Common issues to look out for in log files

    • The main error log will not always give you all the information you want for a svc.
    • You may see alot of failed SSH and FTP connections, that is generally normal.
    • Keep an eye out for MaxClients errors in the Apache logs if a customer is complaining of Apache dying alot. You can check the KB for raising MaxClients settings.
    • If a customer does not set up Log Rotation for a domain under Plesk, then Log Files will build up and may take up alot of unneeded space. You can usually delete old log files in Plesk, and change the Log Rotation to Daily instead of by size.
    • MailLogs can show you if a customer is spamming, or if mail is coming in or out.
    • MySQL Logs should be able to show you general MySQL errors such as bad connections, or corrupted tables. Check the Int. KB for the ‘myisamchk -r’ repair table command.

    V. Advanced Commands

    A. Find. You can do alot with find. for now lets find all files over 10MB.

    cd /
    find / -type f -size +10000k -exec ls -lh {} \; | awk '{ print $5 ": " $9 }' |sort -n
    

    B. Grep. Another handy tool to get specific information

    cat file | grep blah

    (only lists the information where the word blah is found)

    C. Less/More

    less filename.abc 

    (displays the content of a file. arrows to scroll, ‘q’ to quit.)

    more == same thing basically. You can use the ‘| more’ command to scroll through something page or line at a time.

    tail -n 1000 /var/log/httpd/error_log | more

    VI. Vi is a basic text editor.

    Careful what keys you hit while in vi.

    vi /path/to/filename.abc

    TIP:

    You can learn more about using the VI/VIM text editor by reading the following guide:

  • Understanding basic vi (visual editor)
    By on September 16th, 2008 | 2 Comments2 Comments Comments

    vi (visual editor) is included with all (mt) Media Temple services. vi is a full screen editor and has two modes of operation.

    • Command Mode – every character entered is a command.  This is the default mode when you start vi.
    • Insert Mode – this mode allows you to edit. To enter insert mode simply hit i once vi has started.

    NOTE:

    vi is case-sensitive. Be sure to not mix uppercase and lowercase letters when running commands, as the result will not be the same.

    The best way to learn about vi is with the vimtutor, you can start your lesson by typing the following command via ssh:

    vimtutor

    Below is just a short list of a few commands that are very useful for beginners.

    Opening a File in Vi

    This first line is just to simply open a file with vi:

     vi filename

    The following command is used to recover a file that was being edited when the system crashed:

    vi -r filename

    The next command will open a file as read-only:

    vi ew filename 

    To Find a LIne in vi

    You can use the following to go to the last line in the file:

    G

    To go the the first line of the file you can use the following:

    1G 

    To move around in the editor

    • type h to type move the cursor to the left
    • type l to move it to the right
    • type k to move up
    • type j to move down

    To search within VI

    To search for text in vi you can use the “/” key followed by your search term.  This example uses mttext:

    / mttext

    To Exit vi

    To quit and not save changes you can use:

    :q!

    If you want to quit and save changes you can use the following command:

     :x !

    TIP:

    The above examples only hint at the power of vi.  It is very popular amongst developers/administrators for good reason.  We strongly suggest making backups of any files before experimenting with vi, in case you need to revert your changes.