Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

Jan 262010
 

Disable DNS hostname lookup in MySQL

Answer:

If you never use MySQL authentication by hostname, it is better to disable the DNS hostname lookup for better performance. Especially if you are always connecting from localhost, or authenticate remote host by IP address)

To disable this feature, edit the MySQL configurations, e.g. /etc/my.cnf

[mysqld]
...
...
skip-name-resolve

Add the "skip-name-resolve" will do the tricks for you.

Don't forget to restart MySQL to take effect.

# /sbin/service mysqld restart

Jan 262010
 

What are the pdflush processes?

Answer:

When you use the top command, you might notice 2 or more pdflush processes are running actively and wondering what do they actually do.

In fact, when the Linux system want to write data to disk, e.g. write to a file, a special in-memory copies will hold the data blocks belonging to that files which is called the "page cache". For performance reasons, data is usually not always written out (sync) to disk and is temporarily stored in page cache (called "dirty pages").

The jobs of pdflush threads are used to write data out from dirty page caches to disk.

Reference: http://lwn.net/Articles/326552/

Jan 252010
 

How to avoid saving current shell session history

Answer:

It might be happened to your before that you don't want to save the current shell session history, but you don't want to clear all the history by executing "history -c", you can use the following method.

# unset HISTFILE

Logout and type history and you will see last session history was not saved.