Wednesday, December 30, 2009

Cloud era: Pay for your poor performance

I have read an interesting post which claims that in the cloud computing era poor performance directly converts to higher operational costs. http://www.infoq.com/news/2009/11/Price-for-Performance
I agree with this to some extent. Paying for machines is not exactly as paying for CPU but the general idea is interesting.
Thinking about it a bit more it makes me wonder that it will be nice to be able to find the equilibrium point of performance investigation investment. The amount of money that you invest of performization should be less than the amount of time you loose for inefficiency.
A new research area is born :-)

Tuesday, December 8, 2009

Sunday, November 1, 2009

KSE2 is around the corner

Hi,
On the 17th of November the second Knowledge share event is going live.
It will include 3 sessions:
1. Fork/Join Framework
2. What makes good performance
3. Short stories on simple tools

For more info and registration
http://www.performize-it.com/kse/kse2

Saturday, September 12, 2009

Mac OSX Snow leopard better performance

I have upgraded my Macbook to Snow Leopard this weekend and indeed experienced better performance. I have bumped into an interesting article which explains why : (follow link )
To make short story shorter Mac maps 32bit processes to two 4GB address spaces one for user mode and one for kernel mode. As a result any kernel mode system call will require a TLB flush.
Windows by limiting user address space to 2GB and kernel address space to 2GB do not suffer from this problem (but suffer from much lower memory limit). Snow leopard is full 64 bit which solves this issue. User mode and kernel mode address space share the same TLB

Thursday, September 3, 2009

A few comments on my previous post

When you are able to RDP to console session. Most of the times you will be able to connect to the process if you will give it the pid from the windows task manager.
jps which lists only java processes will not work. However jconsole -p will. So there are cases where this technique is not required.

However there are cases when you are not able to connect to the console session. In that case enabling interaction with console option will not help but you can still communicate with files.
Just write a batch file and execute it with cmd.exe -C
you can redirect your input and output to files so you will be still able to communicate with the shell

Monday, July 6, 2009

A neat way to monitor windows services

The JDK supplies a very impressive toolchest which enables you to monitor the JVM(
jconsole, jps, jmap,jvisualvm etc...). There are also other tools such as BTrace which can attach to the JVM and solve performance problems.
On UNIX you only need to use su or sudo and act as the user running the JVM. Doing that you can attach to it and apply all commands.
In Microsoft Windows the situation is more complicated. The service processes run under a different user and in another session and you are not able to connect to them.

But do not panic:-) I am suggesting here a simple workaround.

Step 1:
Download and install the Resource Kit Tools from Microsoft. (The 2003 version will also run on Windows XP). Didn't try Vista/2008 but then again who uses Vista.

Step 2:
Run the following command:
%RESKIT_HOME%\Tools\Instsrv.exe" SrvCMD "%RESKIT_HOME%\Tools\Srvany.exe"
It will create a service named SrvCMD (in case you have such a service use a different name)

Step 3:
Open services.msc and update the service properties to run manually. Check "allow service interact with desktop" box.

Step4:
Execute regedit.
Open the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SrvCMD
Add a sub-key named Parameters
To this sub-key add a string value named Application. Its value will be the name of the executable you want to run. In our case c:\WINDOWS\system32\cmd.exe.

Step5:
Note: If you are connecting with remote desktop make sure you are connecting with /console parameter (otherwise you will not see the command window)
Start the service.
A window with command prompt running in the session of the service will be opened.
jps will now discover your JVM.


Enjoy!

Friday, July 3, 2009

BTrace session slides

BTrace session is over.
I worked very hard preparing it though I think I needed more time for working on the running examples and integrating them seamlessly with the presentation.
It was a fascinating experience for me.It is the first time for me that I am arranging a public session and I am sure that more will come.
37 Attendees(out of max 50 available seats) two and a half hours of covering BTrace.
The responses were very positive. People were very enthusiastic about the tool.
I have published the slides of two presentations from the event in my web site:
The participants of the event are entitled to participate in a lottery upon submitting a final exercise!

Saturday, June 20, 2009

10 Days left

It is 10 days away. My BTrace session. I am so excited about it.
This the first event I am organizing and I hope that ppl will be tolerant toward any organization problems that may occur....
I have just discovered to that my BTrace post was cited in the BTrace project homepage :-)
And today while working on my presentation I discovered that BTrace do not on my Mac (till now used it only on Windows machines)
Browsing the web a bit I found a post by Ken Sipe who already solved the problem.
Downloaded his patched version and bang it worked !!!!!
Lucky me :-)

Wednesday, June 3, 2009

ScalableJ First Knowledge Share Event

I have been thinking about building up an event by myself for a long time and this idea has finally came to life. I am going to give a lecture on BTrace on the 1st of July in Petah Tikva,Israel
Registration is free of charge.
More information can be found at http://www.performize-it.com/training/kse/kse1
You are welcome to participate......

Sunday, May 31, 2009

JDK 1.6.0_14

Well it appears that this revision is not a one to ignore if you care about performance (and you have the guts of an early adapter:-) The "small" revision update is not small at all and contains 3 important performance improvements:
1. The long anticipated G1 garbage collector
2. Escape analysis
3. Compressed OOPs

I will elaborate on these features in my next posts.... for now you may look at http://java.sun.com/javase/6/webnotes/6u14.html

What does this say about JDK1.7 ? Down porting features before 1.7 is released...... makes you wonder is 1.7 going to be Sun's Vista?

Wednesday, May 27, 2009

BTrace the ultimate JVM probe

Hi,
I have been working with BTrace in the last few months and the more I use it the more I appreciate it. BTrace enables you to write a small java class that will instrument you java application on the fly and will give you ultimate flexibiliy to pin-point the requested information.
It can help in debugging/ profiling/ deadlock analysis and solving other stability problems
I am going to give a session 2.5 hours session on the 1/7 in Israel(Petah Tikva). Details will follow..... If you want to attend send me an email to haim.yadid@scalablej.com
Here is a tricky example which will help you identify where in the code a you write a certaion message to stdout..... enjoy!

package com.scalablej.btrace;

import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;

@BTrace public class PrintlnLocator {
@OnMethod(
clazz = "java.io.PrintStream",
method = "println",
location = @Location(value = Kind.ENTRY))
public static void onPrint(Object a, String l) {
boolean b = compare(
get(field(classForName("java.lang.System"), "out")), a);
if (b) {
println(l);
jstack();
}
}

}

Tuesday, April 21, 2009

Utilizing the Cloud for Performance Validation

Yesterday I gave a lecture to the Israeli Association of Grid Technologies (IGT) as part of the cloud computing work group. I was discussing the benefits of executing performance lab for the purpose of load testing inside the cloud (opposed to purchasing required hardware).
You can find the presentation in my website http://www.scalablej.com/cloud-computing

Monday, April 13, 2009

IGT cloud computing Workgroup

Hi
Next Monday (20-Apr-09 14:00-17:00 IDT) I am going to present a case study which will discuss the benefits of performing application load test in the cloud. My presentation will take place in IGT offices in Herzelia and will be part of a meeting of the Israeli cloud computing work group along with two other sessions of Nati Shalom CTO of GigaSpaces and Moshe Kaplan CEO of Rocketier. Registration is free just send an email to info@grid.org.il.
For more information on my session and other session in the WG meeting follow this link
http://www.grid.org.il/?CategoryID=384&ArticleID=137&Page=1

Hope to see you there....

Tuesday, March 17, 2009

Nice enhancement of JDK1.6.0_14

From JDK1.6.0_14 a stack trace dump is added to a hprof memory snapshot this can help profilers display thread and stack is shown for GC roots of types "Stack Local" and "JNI Local".
Yourkit 8.0.3 already utilizes this feature.
Nice!