Skip to content

Connection time out. Careful with your threads

Last week we had a bottle neck on our application and it took us several days to find it. So, here is what you should not do. The architecture is as followed : 2 Alteons to spread the load 2 reverse proxy a layer of Firewalls 2 HTTP compressors 4 web server iPlanet (Sun Java Web Server 6.0) a cluster of 40 Weblogic server running on 4 different boxes a database server. Everything running on HP-Ux11. iPlanet only dispatch static pages and images and Weblogic has the presentation (JSP/Servlet) and EJB layers (it does 99% of the work). The problem was that a lot of connections were falling on time out. We kept on focusing on weblogic and controlling the thread and memory activity to see if we had any dead lock of memory leek (there are some JNI calls somewhere). Weblogic wasn‘t doing anything, not under stressed at all. The application was configured to run 2000 concurent users that‘s why each instance of weblogic was running 60 threads (60 threads * 40 instance = 2400). After some days of analysing and twisting weblogic, we remembered that we had a layer of iPlanets on the front. The admin guys were sure that there was no problem with iPlanet because each server was supposed to run 512 threads. It wasn‘t the case. Each instance was configured with 128 thread (128*4 instance = 512). That was why weblogic was doing nothing and […]

Read More →

God is a .Net Programmer

Part of my company‘s job is to create tailored software for clients. They manage to deliver 5–6 a year and producing each one takes between 200–500 days. For the last 2 years they have developed around 80% using the .Net platform and the remaining 20% using Java. Last year I worked for 1 month with a .Net team trying to re-architect their software, but I gave up. Those guys didn‘t know what a Singleton was, nor a framework, nor even a package ! And because I didn‘t know anything about .Net (and still don‘t) I moved to do other things. The other day I was talking to one of the commercial guys and I asked him why my company wasn‘t putting any effort in trying to do more Java. The answer was quick and precise: “We realized that .Net software is 40% cheaper than Java“ (understand faster to develop for the same price). I was about to argue, bring the technical side, the big mistakes that I spotted during my little experience with .Net, talk about the Java community, the open source framework, the well designed architecture I‘ve worked with and so on. When I realized that he was a commercial guy, wearing a suit and a tie, I had the divine inspiration that made me reply: “God created the universe, the planet and Man in just 7 days. And you can see the mess. Imagine if he had 40% […]

Read More →

I HATE HTML !!!

Am I the only one to hate HTML or is this « language » really a pain in the back ? Like many of you, I am a back-end guy : I love Java, I feel happy when I use hibernate, J2EE doesn’t scare me anymore, Struts has no secret… but behind the Strut’s Form lies the dark side of web applications : HTML (or XHTML) I’m working with some friends on a website that we will soon put online. This time we are not allowed to have dirty Hello World black&white pages. This time there is no HTML designer to do the dirty job of writing HTML for us, so we have to do it. We use a java IDE, Google to find some nice icons and the look for help in the community of javascripters, flashers, designers and htmlers. We have been using Firefox. So we change a JSP, deploy, look at Firefox and see if it looks nice. « Oops, too high, too low, a bit more to the right, the font is not the right one… » and so on and so forth. When in the middle of the development we thought of having a look at Internet Explorer, the difference was amazing. We were using just normal HTML tags (tables, td, tr, div..), nothing fancy. We spent hours and hours trying to make look pretty on both browsers. And we’ve discovered something very sad: <tr> […]

Read More →

10 things to do when your job is really boring

Sometimes, your job is really boring. And I’m not talking about a couple of hours or a day, I’m taking about weeks and even months of boredom. This can be due to several reasons: the project is delayed, the client has not really made up his mind, the budget has not been approved yet, the compliance team is still checking that the JDK 1.3 can be installed, let’s prototype all the MVC frameworks first… But the most common reason is political issues: everybody is waiting for a decision maker to do his job, take a decision. In the meantime, what can you do: Change the situation: the first thing to do is to try to change the situation. Make things go faster, talk to the right people, send emails explaining how this situation could be improved… In one word, be constructive. Most of the time, this is completely utopist because you don’t have the power to make things move on. Shorten your days: if you can, shorten your painful days. Arrive at 10:30am at the office, have a nice long lunch with your bored colleagues and leave at 4:30pm. Cut the morning and the afternoon with coffee breaks. Work on something interesting: there is nothing better than feeling useful, so, work on something you like: your own project or be part of an open source one (plenty to do on sourceforge). To make things easier, buy a portable hard drive […]

Read More →

And the winner is : COBOL !!!

J2EE has nothing new happening ! J2EE is a back-end language ! JCP is too heavy ! Java language is not open sourced ! Ruby on Rails is the next thing ! JRuby looks interesting ! Java is dead ! .Net is easier to develop than Java ! Ruby is more flexible than Java ! J2EE is too complicated when you want to do web development ! And what about PHP ? This is what we can read here and there in blogs, articles, web sites. I have to admit, I’m starting to get confused too. I arrived at the early stages of Java, coming from C and C++, and I thought that was great. When J2EE arrived I was the first one to say “this is cool, developers will have to focus on business requirements rather that wasting time with technical issues that will be held by the server”… and so on and so forth. Unfortunately, J2EE has become so complex that developpers have to read tones of specs and design patterns before developping a simple web app. And what about Ruby, and what about Rails, and what about COBOL ! Maybe like me you have coffee breaks, and maybe like me you work in big companies who have developped their system 30 years ago in Cobol. These companies have started to move to, so called, new technologies. But of course, there are still millions of lines of code […]

Read More →

Migrating from Tiles to SiteMesh in AppFuse 1.5

In this blog I explain how I’ve migrated from Struts Tiles to SiteMesh in a AppFuse 1.5 project. I wanted to do that because I was fedup of dealing with Tiles aliases and also because I’ve used SiteMesh in other projects and it’s really easy to use. Metadata filter-mappings.xml In %ROOT%metadatawebfilter-mappings.xml add the folowing <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern> <!-- These are needed by Tomcat 5 for forwards --> <!--dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher--> </filter-mapping> filters.xml And in the filters.xml file add. <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> </filter> struts-actions.xml Change all the actions parameter from Tiles to path to JSP pages. For example, change from <action path="/login" type="org.apache.struts.actions.ForwardAction" parameter=".login"/> to <action path="/login" type="org.apache.struts.actions.ForwardAction" parameter="/WEB-INF/pages/login.jsp"/> struts-plugins.xml In the %ROOT%metadatawebstruts-plugins.xml delete the reference to Tiles plugin <plug-in className="org.apache.struts.tiles.TilesPlugin" > <set-property property="definitions-config" value="/WEB-INF/tiles-config.xml" /> <set-property property="moduleAware" value="true" /> <set-property property="definitions-parser-validate" value="true" /> </plug-in> Action source code The most painful job is to change all your xDoclet tags so that actions forward to a page and not a tile. So you have to change all action classes that are in %ROOT%srcwebmyappwebappaction for example, refering to your tiles-config.xml, change @struts.action-forward name="architectures" path=".architectures" to @struts.action-forward name="architectures" path="/WEB-INF/pages/architectures.jsp" The other problem that you may find is if you have used tiles.Controller. If yes, just change them to struts actions. JSPs First, change your %ROOT%webcommontaglibs.jsp file. Delete <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> and add <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%> <%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%> Layout to decorator You have to copy and rename the Tiles layout from […]

Read More →

Thank you Skype 2.0beta

I’ve just downloaded Skype 2.0 beta with video. It’s fantastic. I’ve got half of my family in Portugal and half in Australia, so I am a big Skype and Skype Out user. The problem was the video. I had to use Yahoo Msg as well as Skype. But now, with the version 2.0, the video works pretty well I have to say. I was quite impressed. You can even have a full screen image of your friend, while speaking normaly. And it’s just a beta version… I can’t wait to have the final version.

Read More →