2 posts tagged “performance”
We have switched to an EBS deployment to make sure our databases are always backed up and can start a new EC2 instance very quickly from the EBS instance if needed. The first day into the switch, some transactions started performing poorly - from under 1 second to 20 seconds. When we compared the timings from the previous logs almost all transactions had a dip in performance from about double to 20 times.
Most of the web applications work in a front controller pattern. I am going to base my discussion around this front controller.
What is the situation now
- Do you know the "Path and Goals" of people in your application?
The layout of paths will seem right and comfortable only when it is compatible with the process of walking. And the process of walking is far more subtle than one might imagine. - Christopher Alexander? - Do you know the request residence time at the server? Do your know the java application server memory state (Free, Used) for each request?
- Do you know what people are using frequently, humans use 20% things 80% time. Are you aware of that 20%?
- Do you know how many people you are serving now (Being served right now by the server), not the amount of sessions opened ?
- Incase of http POST request, do you know the request meta data (Actions)
A little intimacy test!! How much you scored? Consider you know all these are available to you.
Now I am going to write how to boost your intimacy with your application. I increased my awareness of the application by implementing following access points in the application.
For each request, I recorded the start time when it enters the front controller. I also increases the no. of guests by one.
Long startTime = new Long(System.currentTimeMillis());
guest++;
When the request finishes the processing,
Recorded the endtime, got the diff, calculated max memory, free memory and total memory. Wrote down the detail about the request. Who accessed the system and what request, when....
long endTime = System.currentTimeMillis(); StringBuffer strBuf = " Now you Introspect the data and provide what your application need.. Drawing a path of walk with defined milestones for the remote host and the action ... It gives picture how people are moving? In which milestone they flock around? When they come out of their houses? 99% communications are non-verbal in nature, Don't wait people to give you a feedback. They are telling you all time. Just be present to it. Be aware of it :)
long startTime = ((Long) startInfo).longValue();
long diff = endTime - startTime;
Runtime runTime = Runtime.getRuntime();
long maxMem = runTime.maxMemory()/1024;
long totalMem = runTime.totalMemory()/1024;
long freeMem = runTime.freeMemory()/1024;
strBuf.append("<time>").append(new Datetime()).append("<time>");
strBuf.append("<residencetime>").append(diff).append("</residencetime>");
strBuf.append("<maxmem>").append(maxMem).append("</maxmem>");
strBuf.append("<totmem>").append(totalMem).append("</totmem>");
strBuf.append("<freemem>").append(freeMem).append("</freemem>");
strBuf.append("<guests>").append(guest).append("</guests>");
strBuf.append("</from>").append(req.getRemoteHost()).append("<from>");
.....
guest--;