~pperalta

Thoughts on software development and other stuff

Ode to the 350

with one comment

O’ 350, highlight of my day
how you bring me unspeakable pain
you arrive early when I’m on time
right on time to watch you pass by
when I’m early you’re 10 minutes late
relying on you is such a cruel fate

you make the hot days hotter
and the cold days colder
this is a burden
that is too much to shoulder

some of your drivers
are certifiably insane
making NY cab drivers blush
when they see your road rage

you make me navigate through
six foot snow banks
then break down on the way
as I watch my day tank

during rush hour
you might pass by twice
while eight 77‘s
clog Mass Ave, how nice

so why do I bother
why do I try
when efforts so futile
make a grown man cry

the answer is simple
simple as can be
you’re a cheap way to get around
$1.25 is quite a low fee

so thus I am destined
to rely on mbta
to get me to work
sometime today

now I don’t mean to cuss
or complain and fuss
but can someone please tell me
where the fuck’s my fucking bus?

Edit: Maria suggested I link the last line to the video that inspired it.

Written by Patrick Peralta

February 5th, 2009 at 11:02 am

Posted in General

SIG updates

without comments

The NY Coherence SIG had another large turnout (at least 70+). Slides for the talks are now available for download. For those of you on the west coast, the Bay Area SIG is having its first meeting on February 19th at Oracle HQ.

Written by Patrick Peralta

February 2nd, 2009 at 10:43 pm

Posted in Development

Coherence (and other) activities this week

with 2 comments

There are some Coherence related activities this week that the user community may be interested in.

First, the Winter 2009 NY Coherence SIG will be on Thursday January 29th at the Oracle office on Madison Ave in midtown. Registration is required in order for the bouncers in the lobby to let you in, so be sure to check the link and register if you plan on attending. Yours truly will be talking about using Coherence in production and a peek behind the scenes at the tools and techniques used to provide support for Coherence. We’ll also have one of our customers (Anthony Casalena, Founder and CEO of Squarespace, Inc.) presenting as well as one of our top architects Brian Oliver speaking about using Coherence in a WAN. He just gave a presentation at the London SIG last week that was well received.

For those in the Boston area, you can check out the Boston Scalability User Group in Waltham run by Anthony Chaves. Here is the registration link if you’re interested in attending. This meeting will be a free format discussion on all things scalable, so if you have any questions about a new project or experiences (good or bad, the latter being more entertaining) you’d like to discuss among your peers this is a good opportunity to do so. I should be at this meeting as well.

Update: Due to the weather the Boston SUG meeting has been postponed.

In the virtual world we have a new LinkedIn Coherence Users group that has attracted over 30 members on its first day! If you’re a Coherence user or are interested in networking with Coherence users and architects, feel free to join this group.

While I’m in NY for the SIG, I’m going to try to take some time to check out Joel’s new downtown office.

Written by Patrick Peralta

January 26th, 2009 at 6:02 pm

Log file management in Coherence using Log4J

with 6 comments

By default Coherence logs to stdout, which means that Coherence applications deployed in a container will have these logs managed by said container (including rolling of the logs to keep the files from getting too large.) However, many Coherence grids contain JVMs that run the Coherence cache server process (DefaultCacheServer) which means that managing logs becomes an exercise for the developer or operations person.

An easy solution is simply to indicate the name of the file that Coherence should log to like this:

-Dtangosol.coherence.log=coherence.log

This is by far the simplest approach; unfortunately this means that the log will grow as long as the JVM is alive. For cache servers that have months (or years) of uptime, this will at best result in very large log files and at worse running out of disk space on the volume (not to mention if the volume happens to be the one the OS is running on.) To solve this problem, the most common approach is to use Log4J to manage the logs generated by Coherence.

Here is an example log4j.properties file that could be used for this purpose:

log4j.rootLogger=debug, file
 
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.File=coherence-${pid}.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%m%n
log4j.appender.file.DatePattern='.'yyyy-MM-dd
 
log4j.logger.Coherence=debug
  • In my example I chose to use the DailyRollingFileAppender. The RollingFileAppender which rolls logs over by size can also be used.
  • Note that the ConversionPattern is very simple; it only includes the log message and a newline character. This is because Coherence already prints out the timestamp, version, thread, and other information on each line.
  • The log file name is coherence-${pid}.log. The ${pid} is a system property that will contain the process id of the cache server (see script below.)

Here is the script that I used to launch the cache server:

#!/bin/sh
 
exec java -Dtangosol.coherence.log.level=6 -Dtangosol.coherence.log=log4j \
-Dpid=$$ -cp [...] com.tangosol.net.DefaultCacheServer

Note that I am using -Dtangosol.coherence.log.level to choose the log level. The log level (debug, info, warn) can also be selected using the Log4J configuration, although using the Coherence system property provides finer grained control. The script also sets the pid system property.

Using this technique, the logs generated by Coherence are rolled, making it much easier to archive logs and (if required) to upload them to support.

Written by Patrick Peralta

January 14th, 2009 at 11:10 pm

Posted in Development

Maria digs our car out

with 4 comments

This year’s rendition of Maria getting some fresh winter air and exercise…

Written by Patrick Peralta

December 20th, 2008 at 11:58 am

Posted in General