logo
  • Home
  • About Us

Category Archives: Info

Linux-Some handy commands

How to check which process is using up the most disk resources
iotop -Use the “input output top” command to investigate which process is doing the most IO in real time.

#iotop

Total DISK READ: 0.00 B/s | Total DISK WRITE: 15.57 K/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
946 be/3 root 0.00 B/s 3.89 K/s 0.00 % 0.07 % [jbd2/dm-4-8]
27526 be/4 root 0.00 B/s 3.89 K/s 0.00 % 0.00 % rotatelogs /opt/www/logs/webserver/apache/access_log-%Y-%m-%d-%H 86400
27527 be/4 root 0.00 B/s 3.89 K/s 0.00 % 0.00 % rotatelogs /opt/www/logs/webserver/apache/mod_jk.log-%Y-%m-%d-%H 86400

Capture OS level data to show CPU and Memory usage Thread wise

#top -b -n 1 -H

Or for a specific Process

#top -b -n 1 -H <Process_PID>

Top 10 CPU consuming Process

#ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10

Comparison of CPU utilization

# sar -u 5 10 ( 5 sec of interval & 10 times )

Apache Virtual Hosting

There are two types Apache Virtual Hosting

Name Based Virtual Hosting

With the name based virtual hosting you can host several domains/websites on a single machine with a single IP. All domains on that server will be sharing a single IP. It’s easier to configure than IP based virtual hosting, you only need to configure DNS of the domain to map it with its correct IP address and then configure Apache to recognize it with the domain names.
A technical prerequisite needed for name-based virtual hosts is a web browser with HTTP/1.1 support (commonplace today) to include the target hostname in the request. This allows a server hosting multiple sites behind one IP address to deliver the correct site’s content. More specifically it means setting the Host HTTP header.

Name

IP Based Virtual Hosting

With the IP based virtual hosting, you can assign a separate IP for each domain on a single server, these IP’s can be attached to the server with single NIC cards and as well as multiple NICs.

IP

JDK VS JRE

JDK-JRE

JRE: Java Runtime Environment– It is basically the Java Virtual Machine where your Java programs run on.If you want to run Java programs, but not develop them, download the Java Runtime Environment.

JDK: Java Development Kit -If you want to develop applications for Java, download the Java Development Kit or JDK. It’s the full featured Software Development Kit for Java, including JRE, and the compilers and tools (like JavaDoc, and Java Debugger) to create and compile programs.

Usually, when you only care about running Java programs on your browser or computer you will only install JRE. It’s all you need. On the other hand, if you are planning to do some Java programming, you will also need JDK.

Sometimes, even though you are not planning to do any Java Development on a computer, you still need the JDK installed. For example, if you are deploying a WebApp with JSP, you are technically just running Java Programs inside the application server. Why would you need JDK then? Because application server will convert JSP into Servlets and use JDK to compile the servlets.

mod_cluster VS mod_jk and mod_proxy

mod_cluster advantages over other httpd-based load balancers mod_jk and mod_proxy

Server-side load balance factor calculation

In contrast with traditional httpd-based load balancers, mod_cluster uses load balance factors calculated and provided by the application servers, rather than computing these in the proxy. Consequently, mod_cluster offers a more robust and accurate set of load metrics than is available from the proxy.

Dynamic configuration of httpd workers

Traditional httpd-based load balancers require explicit configuration of the workers available to a proxy.
Like mod_jk maintain the static worker list in worker.properties but mod-cluster allow dynamic worker list means whenever the user load increases you can add Application server nodes dynamically to balance the load. In mod_cluster, the bulk of the proxy’s configuration resides on the application servers. The set of proxies to which an application server will communicate is determined either by a static list or using dynamic discovery via the advertise mechanism.
The application server relays life-cycle events (e.g. server startup/shutdown) to the proxies allowing them to effectively auto-configure themselves. Notably, the graceful shutdown of a server will not result in a fail-over response by a proxy, as is the case with traditional httpd-based load balancers.

Fine grained web-app lifecycle control

Traditional httpd-based load balancers do not handle web application undeployments particularly well.
From the proxy’s perspective requests to an un-deployed web application are indistinguishable from a request for an non-existent resource, and will result in 404 errors. In mod_cluster, each server forwards any web application context lifecycle events (e.g. web-app deploy/un-deploy) to the proxy informing it to start/stop routing requests for a given context to that server.

mod_cluster advantages over mod_jk

AJP is optional

Unlike mod_jk, mod_cluster does not require AJP. httpd connections to application server nodes can use HTTP, HTTPS, or AJP.

Ho to check Linux machine is Physical or Virtual remotely?

We can use the command :-

[[email protected] ~]# dmidecode -s system-product-name
ProLiant DL360 G7

[[email protected] ~]# dmidecode -s system-product-name
VMware Virtual Platform

[[email protected] ~]# dmidecode -s system-manufacturer
Red Hat

First is HP ProLiant, second one is VM ware and Third one is KVM Instance

Install local rpm files using yum

We can use the command yum localinstall /path/to/file.rpm file. This command will install the local rpm file and search for required rpms (dependencies) on RHN or other repositories that are configured and install it for the user.

#yum localinstall /path/to/RPM_FILE.rpm

Want to install a package other than default directory

Want to install a package other than default directory 

Use :-
1.  rpm -ivh –prefix==<directory-name> <rpmname>
e.g rpm –prefix=/home/chroot/ mysql-server*.rpm
2.  yum –installroot=<directory-name> install <package-name>
e.g yum –installroot=/opt/linux/ install mysql-server

Note- Packages that can be installed on diff directory are called “relocatable packages”. Above commands works only for these type of packages.and not for all.

CPU‬ Load in Linux

The load average represents the work being done by the system. The three numbers show the load averages for the last minute, 5 minutes and 15 minutes, respectively. A load average of 1 reflects the full workload of a single processor on the system. A load of 2 on a system with two CPUs means that those CPUs were working at maximum. On a system with four CPUs, that 2 reflects a workload using about half of the available processing power.

‪#‎w‬
load average: 1.45, 0.80, 3.07

load average over the last 1 minute: 1.45

load average over the last 5 minutes: 0.80

load average over the last 15 minutes: 3.07

To understand the load average number, you need to know how many CPUs your system has. A load average of 7.05 would indicate a system with a single CPU was massively overloaded, but it would be fine on a computer with 8 CPUs.

Command to get today’s CPU load average statistics:

‪#‎sar‬ -q | less

32bit Java VS 64bit Java

How to check java 32 bit or 64 bit
[[email protected] opt]# java -d64 -version
[[email protected] opt]# java -d32 -version
java version “1.6.0_45”
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)

In computer architecture, 64-bit computing is the use of processors that have datapath widths, integer size, and memory addresses widths of 64 bits (eight octets/bytes). Also, 64-bit CPU and ALU architectures are those that are based on registers, address buses, or data buses of that size. From the software perspective, 64-bit computing means the use of code with 64-bit virtual memory addresses. Similarly, 32-bit computing, CPU or 32-bit programming uses 32 bits (four octets/bytes) for all above purposes.
Continue reading →

Like Us

Archives

  • December 2015 (4)
  • October 2015 (12)
  • September 2015 (2)

Categories

  • Apache
  • Info
  • Java
  • JBoss
  • Linux
  • Tips&Tricks
  • About Us