quinta-feira, 21 de junho de 2012

Discussion about Apache timetaken, mod_log_config and mod_log_firstbyte

1. Introduction

"Ever tried logging Apache page serve times using '%D'? You'll have discovered that they aren't a good index of your server's performance, because they depend more on the client's connection speed, computer and browsing habits than on the speed of your server. mod_log_firstbyte is a module for Apache 2.0 which allows you to log the time between each request being read and the first byte "

"I'm trying to work out how long it takes to deliver a page, not dependant on network latency or bandwidth"

"Still, I want to outline that these values are not the values taken by the server to generate the page (I mean to interpret a php script and show the output), but the time taken to ‘serve’ the page. You might see big times for slow internet users. For ex. I had the php sample page shown above, generated in 0.0847 seconds, while in the logs it will show 0.095491 and this because it was a small page and the connection fast. Basically you will add extra the time to establish a tcp connection and to transfer the data from the server to the client"

"But how long it takes to deliver a page is all about network latency and bandwidth. Also, the webserver has no concept of "pages" - only URLs - typically a URL will be composed from multiple URLs, hopefully some of them will be cached. While there are some very expensive tools which try to derive page load times serverside, I've yet to see one which works well with caching and/or PRG"

quarta-feira, 20 de junho de 2012

Install Java 1.6 JDK SE On CentOS 5

1. Download and updating packages

1.1 pre-requisites

$ yum install -y jpackage-utils

 

1.2 Download manualy from


2. Build packages

$ mkdir /opt
$ mkdir /opt/java
$ cd /opt/java
$ chmod a+x jdk-6u33-linux-i586-rpm.bin
$ ./jdk-6u33-linux-i586-rpm.bin

3) Create symbolic link to Java JDK 1.6


$ which javac
$ ls -la /usr/bin/javac
$ #backup
$ mv /usr/bin/javac /usr/bin/javac.bkp.2012-06-20
$ ln -s /usr/java/jdk1.6.0_33/bin/javac /usr/bin/javac

4) Test symbolic link to Java JDK 1.6

$ javac -version
$ cd /tmp
$ cat HelloWorld.java 
class HelloWorld {
   public static void main(String args[]) {
     System.out.println("HelloWorld!"); 
  }
}
$ javac -cp . HelloWorld.java
$ java -cp . HelloWorld
HelloWorld! 


5. References

Install Java JRE 1.6 SE on CentOs 5.5

1) Download RPM package


$ mkdir /opt
$ mkdir /opt/java
$ cd /opt/java
$
$ # download Java JRE from http://www.oracle.com/technetwork/java/javase/downloads/jre6-downloads/

2) Install package


$ # change permission to execute
$ chmod a+x jre jre-6u33-linux-i586-rpm.bin
$ ./jre-6u33-linux-i586-rpm.bin


3) Create symbolic link to Java JRE 1.6


$ which java
$ ls -la /usr/bin/java
$ #backup
$ mv /usr/bin/java /usr/bin/java.bkp.2012-06-20
$ ln -s /usr/java/jrel1.6.0_33/bin/java /usr/bin/java

4) Test Java JRE 1.6


$ java -version


5) References