Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GlassFish on Windows vs RedHat

Wondering if it matters (reliability wise) choosing Redhat or Windows 2003 Server? Assume equal skills in both. Thanks

like image 563
bmw0128 Avatar asked Jun 04 '09 16:06

bmw0128


2 Answers

If you check the glassfish source, specifically ./appserv-commons/src/java/com/sun/enterprise/util/io/FileUtils.java, you'll see all of the contortions that Glassfish goes through in order to delete/rename files and directories on Windows.

This is a Windows problem, with its restrictions on deleting and renaming open files.

There are all sorts of tricks in there, including requesting a GC from the JVM multiple times in the hope of closing the file stream, "pseudo" renaming, sleep-try loops.

Some examples:

/**
 *Attempts to delete files that could not be deleted earlier and were not overwritten.
 *<p>
 *On Windows, the method requests garbage collection which may unlock locked
 *files. (The JarFile finalizer closes the file.)

/*
     *On Windows, as long as not all leftover files have been cleaned and we have not
     *run the max. number of retries, try again to trigger gc and delete
     *each remaining leftover file.
     */

/**
 * Windows has BIG issues renaming a directory that is open somnewhere -- e.g. if
 * a DOS box is opened anywhere in that directory.
 * This method will try to do a "virtual renaming" if there are problems
 * I.e. it attempts to do a simple rename, if that fails it will copy everything under
 * the original directory to the renamed directory.  Then it will delete everything
 * under the original directory that the OS will allow it to.

In practice this sometimes translates to borked deployments or redeployments on Windows, as some files cannot be deleted or moved and end up being left behind. Of the 50 or so Glassfish instances I run I've never had a problem on Solaris 10 and always have problems relating to this on Windows.

In short, any *NIX will be better for this reason alone, other platform admin considerations aside.

like image 101
sam_pointer Avatar answered Oct 31 '22 15:10

sam_pointer


I think you'll find most people will argue Redhat over Windows for reliability. Glassfish itself should run the same on either.

You should probably ask this on Server Fault

like image 42
Cogsy Avatar answered Oct 31 '22 15:10

Cogsy