Posts

10 iozone Examples for Disk I/O Performance Measurement on Linux

Along with Monitoring different aspects on Linux server measuring IO subsystem performance is also going to be very important.        If someone is complaining that a database (or any application) running on one server (with certain filesystem, or RAID configuration) is running faster than the same database or application running on another server, you might want to make sure that the performance at the disk level is same on both the server. You can use iozone for this situation.            If you are running your database (or any application) on certain SAN or NAS environment, and would like to migrate it to different SAN or NAS environment, you should perform filesystem benchmakring on both the systems and compare it. You can use iozone for this situation.       If you know how to use iozone, you can pretty much use it for various filesystem benchmarking purpose. Download and Install IOZone Iozone is an open so...

Linux File Systems: Ext2 vs Ext3 vs Ext4

Linux File Systems: Ext2 vs Ext3 vs Ext4 ext2, ext3 and ext4 are all filesystems created for Linux. This article explains the following: High level difference between these filesystems. How to create these filesystems. How to convert from one filesystem type to another. Ext2 Ext2 stands for second extended file system. It was introduced in 1993. Developed by Rémy Card. This was developed to overcome the limitation of the original ext file system. Ext2 does not have journaling feature. On flash drives, usb drives, ext2 is recommended, as it doesn’t need to do the over head of journaling. Maximum individual file size can be from 16 GB to 2 TB Overall ext2 file system size can be from 2 TB to 32 TB Ext3 Ext3 stands for third extended file system. It was introduced in 2001. Developed by Stephen Tweedie. Starting from Linux Kernel 2.4.15 ext3 was available. The main benefit of ext3 is that it allows journaling. Journaling has a dedicated area in the file system, where...

How to Increase Screen Size or Resolution in Virtualbox for Ubuntu or Linux

Image
When a new Virtual Machine, or Virtual PC, is setup in Virtualbox for Ubuntu, or another Linux flavor, the screen size and screen resolution may be fixed smaller than your maximum resolution setting. This problem can be fixed by installing Guest Additions. Guest Additions comes with Virtualbox, but is installed after you setup your Virtual Machine, or Guest OS, to add features such as increased screen size or screen resolution. On the test PC for this example the maximum resolution is 1280 x 1024. After loading Ubuntu under Virtualbox bring up the Display Preference by going into System -> Preferences -> Display. The maximum resolution option listed is 800 x 600. Installing Guest Additions from Gnome Desktop To get a bigger screen resolution we will need to install Guest Additions. On the Virtualbox File Menu click on Devices -> Install Guest Additions.   You should now see a vboxadditions_x file now located on your Ubuntu desktop.   To o...

Dovecot POP3/IMAP Server Setup Howto for RHEL/CentOS 5

Image
 Dovecot:        Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory .   Install Dovecot:   Installing and setting up Dovecot in Red Hat Enterprise Linux 5 or CentOS 5 is easy. All we have to do is to enable the services we would like to provide and we are good to go.   Make the use of yum or download dovecot and install it. Here I have  installed it using yum. i.e use  # yum install dovecot Configure Postfix: Go to the main configuration file dovecot.conf in /etc/dovecot.conf . We need to change a few key items.   Find the following keys and change its values as follows protocols = pop3 pop3s imap imaps mail_location = maildir:~/Maildir/ pop3_uidl_format = %08Xu%08Xv imap_client_workarou...

Postfix MTA Configuration

Image
Firstly Lets Introduce with Term POSTFIX: Postfix:  In computing, Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail. It is intended as a fast, easier-to-administer, and secure alternative to the widely-used Sendmail MTA. Install Postfix: Make the use of yum or download postfix and install it. Here I have  installed it using yum. i.e use  # yum install postfix   Configure Postfix: Go to the main configuration file main.cf in /etc/postfix/ directoy W e need to make it listen to network request, accept mails bound to our domain and use maildir which is a better mailbox format than mbox the default.   Find the following keys and change its values as follows. inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain home_mailbox = Maildir/   In main.cf, lines starting with # are comments. Save the file after completing your changes. Make sure that all mail_spool_directory li...

DNS Server Interview Questions And Answers for linux admin

DNS Server Interview Questions And Answers for linux admin Q: - which are the important configuration files for DNS server ? BIND uses /etc/named.conf as its main configuration file, the /etc/rndc.conf file as the configuration file for name server control utility rndc, and the /var/named/ directory for zone files and the like. Q: - What is BIND ? BIND stands for Berkeley Internet Name Domain which is the most commonly used Domain Name System (DNS) server on the Internet. Q: - On which version of bind u have worked ? BIND 9 Q: - What is the role of DNS ? A DNS server, or name server, is used to resolve an IP address to a hostname or vice versa. Q: - On which port DNS server works ? DNS servers use port 53 by default. Incoming and outgoing packets should be allowed on port 53. Also allow connections on port 921 if you configure a lightweight resolver server. The DNS control utility, rndc, connects to the DNS server with TCP port 953 by default. If you are running rn...

RAID 01 Vs RAID10

Difference between RAID 0+1 vs RAID 1+0? We have covered RAID levels before in our posts. You can read about the different RAID levels here and the I/O characteristics here.  While building up a DR (Disaster Recovery) environment for one of our clients, one of the questions asked by the client was: “How is RAID 1+0 different than RAID 0+1?”.  Both RAID 0+1 and RAID 1+0 are multiple RAID levels which means that they are created by taking a number of disks and then dividing them up into sets. And within each of these sets, a single RAID level is applied to it in order to form the arrays.  Then, the second RAID level is applied at the top of it to form the nested array.  RAID 1+0 is also called as a stripe of mirrors and RAID 0+1 is also called as a mirror of stripes based on the nomenclature used for RAID 1 (mirroring) and RAID 0 (striping).  Let’s follow this up with an example: Suppose that we have 20 disks to form the RAID 1+0 or RAID 0+1 ar...

What RAID is Best for You?

What RAID is Best for You? Most of you are familiar with the basic RAID technologies avaible out there today, but it is always good to have too much information about this topic than not enough. Here is a brief yet informative summary of the most popular hardware RAID configurations, including pros and cons for each: RAID-0 (Striped) Does not provide fault tolerance Minimum number of disks required = 2 Usable storage capacity = 100% This is the fastest of the RAID configurations from a read-write standpoint Is the least expensive RAID solution because there is no duplicate data Recommended use for temporary data only RAID-1 (Mirrored) Fault tolerant – you can lose multiple disks as long as a mirrored pair is not lost Minimum number of disks required = 2 Usable storage capacity = 50% Good read performance, relatively slow write performance Recommended for operating system log files RAID-5 (Striped with Parity) Fault tolerant – can afford to lose one disk only Mi...

Useful Linux Tips

Task File / Command Startup script /etc/rc.d/rc Kernel /boot/vmlinuz Kernel Parameters sysctl -a Reconfigure the kernel cd /usr/src/linux  make mrproper   make menuconfig   make dep   make clean   make bzImage  make install  make modules  make modules_install cp arch/i386/boot/bzImage /boot/vmlinuz-2.2.16  mkinitrd /boot/initrd-2.2.16.img 2.2.16  vi /etc/lilo.conf  lilo List modules lsmod Load module insmod Unload module rmmod Initialize system netconf Physical RAM free -m Kernel Bits getconf LONG_BIT Crash utility lcrash Trace System Calls strace Machine model uname -m OS Lev...

Linux Admin Q&A

Interview Questions And Answers Q: - How are devices represented in UNIX? All devices are represented by files called special files that are located in /dev directory. Q: - What is 'inode'? All UNIX files have its description stored in a structure called 'inode'. The inode contains info about the file-size, its location, time of last access, time of last modification, permission and so on. Directories are also represented as files and have an associated inode. Q: - What are the process states in Unix? As a process executes it changes state according to its circumstances. Unix processes have the following states: Running : The process is either running or it is ready to run . Waiting : The process is waiting for an event or for a resource. Stopped : The process has been stopped, usually by receiving a signal. Zombie : The process is dead but have not been removed from the process table. Q: - What command should you use to check the number of files and ...

Apache Interview QA

Interview Questions And Answers Q: - What is location of log files for Apache server ? /var/log/httpd Q: - What are the types of virtual hosts ? name-based and IP-based. Name-based virtual host means that multiple names are running on each IP address. IP-based virtual host means that a different IP address exists for each website served. Most configurations are named-based because it only requires one IP address. Q: - How to restart Apache web server ? service httpd restart Q: - How to check the version of Apache server ? rpm -qa |grep httpd Q: - What is meaning of "Listen" in httpd.conf file ? Port number on which to listen for nonsecure (http) transfers. Q: - What is DocumentRoot ? it is a location of files which are accessible by clients. By default, the Apache HTTP server in RedHat Enterprise Linux is configured to serve files from the /var/www/html/ directory. Q: - On which port Apache server works ? http - port 80 https - port 443 Q: - Tell me...

Redirect thread dump to another file?

On Jboss or Tomcat application server, we usually use kill -3 PID to get thread dump to default STDOUT which is catalina.out under $Tomcat_Home/logs folder. It might be nature to use command kill -3 PID > some.file 2>&1 to try to redirect the thread dump info to some.file than default one. However, it will not work. The reason is kill is just a command to send a signal to a process. You are redirecting the output of the kill command itself rather than the process (what the process does upon receipt of a signal is separate), so the redirect (supposed to kill command itself) has no effect on which file the process (PID) will write to. Given that, if we need redirect thread dump for that process to some other file, we need add redirects to that process when it starts. Another popular way is to use jstack -F PID to get the whole thread dump forcefully. "jstack" : A JVM troubleshooting tool that prints stack traces of all running threads of a given JVM proce...

Taking Thread Dump in Linux

Generating a Thread Dump on Linux, including Solaris and other Unixes 1.) Identify the java process that JIRA is running in: This can be achieved by running a command similar to: [root@server2~]#ps -ef | grep java root      8876  8854 12 10:54 pts/5    00:08:37 /usr/jdk1.6.0_16/bin/java -Dprogram.name=run.sh -server -Xms256m -Xmx1024m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/data2/jboss/lib/endorsed -classpath /data2/jboss/bin/run.jar:/usr/jdk1.6.0_16/lib/tools.jar org.jboss.Main -c all -b 192.168.2.102 -Djboss.messaging.ServerPeerID=1 root     10154  9577  0 12:02 pts/3    00:00:00 grep java   2.) Find the process ID of the JVM and use the ps command to get list of all processes:  kill -3 The thread dump will be printed to Confluence's stan...

Java Thread Dump

Understanding a Java thread dump 1. Introduction In my opinion, one of the greatest things about Java is the ability to get meaningful thread dumps on a running production environment without having to enable DEBUG mode. The thread dump is a snapshot of exactly what's executing at a moment in time. While the thread dump format and content may vary between the different Java vendors, at the bare minimum it provides you a list of the stack traces for all Java threads in the Java Virtual Machine. Using this information, you can either analyze the problem yourself, or work with those who wrote the running code to analyze the problem. 2. What is a stack trace? I mentioned earlier that the thread dump is just a list of all threads and the full stack trace of code running on each thread. If you are a J2EE Application Server administrator and you've never done development before, the concept of a stack trace may be foreign to you. A stack trace is a dump of the curre...