|
|
|
Back to newsletter 230 contents
I have a piece of advice for you, and a request from you. The piece of advice is to track the lifetime of your connections. The request is: please tell me if you know of any generic connection tracking tool. Read on to know why ...
Abstraction is essential for good programming, but the more you abstract, the deeper you hide what is actually happening. I'm seeing connections that have now been abstracted so much that in many cases it's not obvious how to most efficiently use the abstraction, leading to non-optimal levels of connection churn, and sometimes connection leaks.
For example, many connection pool implementations do not make it clear that you should be reusing the connection pool rather than creating a new one. I've seen code implementations that simply throw away the pool and create a new one - because the abstraction looks like that's the way it should be done, and not really because of programmer carelessness. Tests will not show any problems, even load tests will be fine ... up to a point when suddenly the system can't keep up with the connection churn and IO will start lagging dramatically. Chances are you'll only see it in production.
Sure if you started the service in your debugger and watched the threads, you'd see thread churn like mad, but it's actually unusual to be looking at that. Typically when debugging you'll be stepping through some problem, and in that state you are unlikely to see any connection churn.
So watch your connections (and the threads that manage them), and do tell me if you know of useful tools here. Now on to this month's tips, tools, news, articles and talks. And of course the tips from this month's articles and talks, as ever are extracted into this month's tips page.
Java performance tuning related news.
Java performance tuning related tools.
Back to newsletter 230 contents