Allocated memory and VMWare

2010-01-15 Thread Abel MacAdam

Hi,

We manage several customers on VMWare systems. Their Tomcat installation is
used by a Content Management System written in Java. I have a question about
what happens with Tomcat when memory it has configured is not available when
necessary.

Our Tomcat installations should use 500 MB (-Xmx516m). But when that memory
is not used, VMWare will take it away, and give it to other VMWares that are
in need of memory. This will not be a problem for a while. But at one moment
Tomcat may wish to use this memory, and VMWare will not be able to supply it
directly. What will happen in that case?

Abel
-- 
View this message in context: 
http://old.nabble.com/Allocated-memory-and-VMWare-tp27173356p27173356.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Allocated memory and VMWare

2010-01-15 Thread Abel MacAdam
So I take it we should reserve the 500 MB with fixed (or rigid I think it is
called) memory? That might cause other problems *). Thanks for the response.


*) When you reserve flexible memory the OS of the system VMWare runs on you
get a situation where more memory is allocated then flexible is available.
Compare it with airplane seets that often are oversold. By reserving rigid
memory I'm told the whole equation becomes far more complex.

On Fri, Jan 15, 2010 at 10:42 AM, André Warnier a...@ice-sa.com wrote:

 Mark Thomas wrote:

 On 15/01/2010 08:57, Abel MacAdam wrote:

 Hi,

 We manage several customers on VMWare systems. Their Tomcat installation
 is
 used by a Content Management System written in Java. I have a question
 about
 what happens with Tomcat when memory it has configured is not available
 when
 necessary.

 Our Tomcat installations should use 500 MB (-Xmx516m). But when that
 memory
 is not used, VMWare will take it away, and give it to other VMWares that
 are
 in need of memory. This will not be a problem for a while. But at one
 moment
 Tomcat may wish to use this memory, and VMWare will not be able to supply
 it
 directly. What will happen in that case?


 I suspect you will see slow response times until the virtual machine is
 allocated the memory it needs/expects. The interaction of the JVM/OS/VM
 is going to be complex. It is probably easier to just try it and see.

 Mark

  I guess you could also remove one variable out of the equation, and add a
 -Xms516m switch, making the JVM allocate the 516 MB right at start.
 I am told that this is also more efficient (Java-wise), because it avoids
 the JVM have to readjust the memory all the time.

 As Mark hints at, if you have 3 levels of memory management, each one of
 them allocating/deallocating memory dynamically, the final result is likely
 to be rather inefficient.

 So either you set VMWare to allocate (and reserve) a fixed amount of memory
 for this virtual machine, and inside it let the OS and Java allocate memory
 dynamically, or else you let VMWare allocate memory more dynamically
 (overbooking the total available memory) between several virtual machines.
 But then, when there is not enough physical memory available to let a given
 virtual machine run, I suspect VMWare will just freeze it out until there is
 enough memory available. Or it will start swapping, which should have a
 pretty dramatic effect on the performance of /all/ virtual machines.
 What VMWare exactly does in that case, is a question to ask on a VMWare
 support forum though.  If you do, maybe let us know the answer ?

 Basically, there is no such thing as a free lunch..



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Simple Howto: Follow up

2007-12-17 Thread Abel MacAdam
Hi,

I saw a mail requesting simple instructions on gettting Tomcat and Apache
working together. The answer is printed out and ready to be processed. But
I have some follow ups on that mail:
- Why should one connect Tomcat to Apache?
- Should you connect Tomcat 6.0.14 to Apache 2.2.6? (Or is that done
automagically, as I seem not to find the appropriate mod_jk for these
versions)

TIA,
Abel


Tomcat 6.0: placement JAAS config file?

2007-12-14 Thread Abel MacAdam
 Hi all,

I just got my JAAS example working on Tomcat 6.0. To accomplish that I
created a directory in webapps called myjaas, placed my jsp file, and
jaas.config file in that directory, and placed my jar-file in
myjaas\WEB-INF\lib. Next I added the placement of my jaas.config to the
'Java Options' in the tab 'Java' in the 'Apache Tomcat Properties' window,
and restarted Tomcat.

My question. I tried different places of the jaas.config file. One of them
in the $CATALINA_HOME\conf directory (while changing the 'Apache Tomcat
Properties' accordingly). But I now had the error that the LoginModule I
made could not be found.

I would think a jaas configuration file should belong in the conf/
directory. I could not make it happen. Is the place correct which I
described in the first paragraph, or should it be placed in
$CATALINA_HOME\conf? Do you have any other comments (like the wisdom of
setting the location of my jaas.config in 'Apache Tomcat Properties' )

Looking forward to your comments.
Abel


Beginner question: Configure Tomcat for JAAS?

2007-12-13 Thread Abel MacAdam
Hi,

This is a beginner question :-(. I'm trying to get JAAS to work on my Tomcat
(6.0.12) installation. I used code from a Javaworld article (
http://www.javaworld.com/javaworld/jw-09-2002/jw-0913-jaas.html)

Of course I had to configure my Tomcat to work together with JAAS. The
document I used is:
http://tomcat.apache.org/tomcat-6.0-doc/printer/realm-howto.html

According to the Tomcat doc I have to do the following steps before I can
use JAAS to authenticate a user:
1. Develop your code. Place the compiled classes in Tomcat's classpath
2. Setup a login.config file for Java, and tell Tomcat where to find it (set
JAVA_OPTS)
3. Configure the JAASRealm in your server.xml

1 Develop code: I use the following classes:
PassiveCallbackHandler.java
RdbmsCredential.java
RdbmsLoginModule.java
RdbmsPrincipal.java
These classes I put in the package rdbmsjaas.
In the %CATALINA_HOME%/webapps/Javaworld_Jaas/WEB-INF/lib directory I
created the rdbmsjaas.jar file.

The jsp is called jaas.jsp, and is stored in
%CATALINA_HOME%/webapps/Javaworld_Jaas

2. Setup login.config
In %CATALINA_HOME%\conf I saved the file Javaworld_all_that_Jaas.config,
containing:

Example {
   RdbmsLoginModule required
   debug=true
   url=jdbc:mysql://localhost/jaasdb?user=javauserpassword=javadude
   driver=com.mysql.jdbc.Driver;
};

I created an XP Environment Variable JAVA_OPTS with the value -DJAVA_OPTS=-
Djava.security.auth.login.config==C:/Program Files/Apache Software
Foundation/Tomcat 6.0/conf/JavaWorld_All_That_Jaas.config (excluding  and
)
I used the fully qualified address, instead of
$CATALINA_HOME/conf/JavaWorld_All_That_Jaas.config. I think XP balks when it
sees $CATALINA_HOME).

3 Configure JAASRealm in server.xml
In %CATALINA_HOME%\conf\ I changed web.xml. I added the following lines:

  Realm className=org.apache.catalina.realm.JAASRealm
 appName=jaas
 userClassName=rdbmsjaas.RdbmsPrincipal
 debug=99
   /

If I run the jsp from http://localhost:8080/JavaWorld_Jaas/jaas.jsp, I can
enter my username/password, but when I click the Submit button, I get:

Caught Exception: java.lang.SecurityException: Unable to locate a login
configuration



Where did my configuration go wrong?

Abel