3

We are running an Amazon EC2 R3 instance so has 30G of memory available. We are running 5 Apache Tomcats (version 7). According to lsb_release -a the version of Ubuntu is: Ubuntu 14.04.2 LTS

Tomcats keep terminating on this machine from unknown conditions. This machine is more than adequate to run many Tomcats and after a single Tomcat termination, running free -h shows at least 10G available.

When I run the command cat/proc/swaps the following is displayed:

cat /proc/swaps
Filename                                Type            Size    Used    Priority

Does this mean that no swap partition is in place? Running the swapon command shows the same output:

swapon -s
Filename                                Type            Size    Used    Priority

Running the top command shows:

Swap:        0 total,        0 used,        0 free.

So do these results show that no swap is available for when processes need it or does it show no swap is currently being used?

1

As long as there is free memory available, the system will never use swap. In fact, swapping should be avoided in a system as possible...

On the other hand, in your case, it seems that you don't have a swap partition. Otherwise you should see something like this:

$ swapon -s 
Filename                Type        Size    Used    Priority
/dev/sdb1                               partition   1952764 0   -1
  • Agree about avoiding swapping, but I am trying to determine why the "watchdog" is terminating my Tomcats (assuming that is what is happening). So does the output above show that I have no swap space allocated or no swap space is being used or do I need to run another process to find out my swap size? – Phil Jul 9 '15 at 12:31
  • Try sudo fdisk -l to see your partitions – Daniel Lopez Jul 9 '15 at 12:35
  • This results in: Device Boot Start End Blocks Id System /dev/xvda1 * 16065 16771859 8377897+ 83 Linux so this indicates no swap partition. Thank you for clearing that up. – Phil Jul 9 '15 at 12:51
0

If I were You , I'd use multiple smaller EC2 Instances (t2 mini-micro) each for dedicated tomcat with dedicated hostings usin an EBL( Elastic Load Balancer) & ASG (auto scaling groups). It will give a more robust package as far as multiple apache are under consideration and will be more cost efficient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.