The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tomcat and Memory

Discussion in 'General Discussion' started by dgbaker, Oct 4, 2002.

  1. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Just want to verify something. I installed the Tomcat package jsp-install-4.x.tar.gz from layer1. And I noticed that on a new server with only 2 accounts with servlets enabled, the memory is being sucked up. Just want to know if this is nornal.

    total used free shared buffers cached
    Mem: 254932 247252 7680 0 14836 162544
    -/+ buffers/cache: 69872 185060
    Swap: 530104 0 530104

    Top shows :about 30 java each with 25M RSS and only 8752 shared 10.3% mem

    Any thoughts welcome. I myself am used to weblogic so tomcat is kinda different.

    Thanks :)

    David Baker
     
  2. portman

    portman Well-Known Member

    Joined:
    May 23, 2002
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    As I understand it (Please correct me if I am wrong) but Java on a CPanel server is quite inefficient. I beleive it stars several Java processes for each defined user.

    We only use it on limited use servers because of this. Kind of funny since we onlt run it on servers where we run both 3 and 4.

    :)
     
  3. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    Only if your hardware is insufficient. WHM will install 2 java instances for each domain for which you have enabled Tomcat. One for the standard domain.com and one for www.domain.com.

    I personally have well over 75 Tomcat-enabled customers on each server and have minimal problems. There's the occassional Tomcat restart needed for a run-away java process, but that should be expected on any shared JVM, whether or not it is a WHM/CPanel installation. There's a few other small quirks, but nothing major. We also reboot Tomcat nightly so those customers that require a web.xml file (most don't) get any changes read into the system. This also helps clean things up on a a regular basis.

    Jaz
     
  4. blueboxservers.com

    Joined:
    Jul 5, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    we installed tomcat 4.0.3 from cpanel and just wondered if upgrading to 4.0.5 is as easy as running the jsp-install-4.x.tar again? As I believe tomcat 4.0.3 has some serious security issues

    http://jakarta.apache.org/site/news.html#0924.1
     
  5. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Things do work...

    Things are working fine, I was more curious on memory numbers. In weblogic I can set a min and max for memory as well as force swap. Can that be done in tomcat? and if so what are the setting params to use.
     
  6. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    That's a tough call. I've never tried running Tomcat on a server with only 256M RAM. Everything we have has 1G installed.

    Jaz
     
  7. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    [quote:591c99658b][i:591c99658b]Originally posted by jsteel[/i:591c99658b]

    Only if your hardware is insufficient. WHM will install 2 java instances for each domain for which you have enabled Tomcat. One for the standard domain.com and one for www.domain.com.

    [/quote:591c99658b]

    Okay, I have a server with only two domains and localhost having servlets. When tomcat is started it spawns 36 java processes. Any ideas why?

    David
     
  8. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    How many host entries do you you see in your server.xml file?

    Jaz
     
  9. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    There are four entries.

    two - with www
    two -without www

    (just adding another now for a sub-domain)
     
  10. kt

    kt Active Member

    Joined:
    May 4, 2002
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    I got the same thing happening... its start about 30 or so processes. JSP works good, but servlets say not 404 found or unavailable...I am thinking of just uninstalling the whole thing all together. Its a pain.....



    KT
     
  11. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    KT - I've done the reinstall the reconfigure etc... to no avail. The one thing I have found is that the trick of modify the gentomcatlist script also causes tomcat to fail completly. I don't know if the two are related or not.

    As for general functionality everything is working fine. Including jsp in sub-domains. Just the amount of process is weird.
     
  12. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    The 30 or so processes is not a bad thing. Tomcat starts new processes for each thread. There is a very good chance that the two customers you have are generating 30 threads between them. The amount of CPU/Memory used you see in the process list is not for each thread; it is actually for all of the threads combined.

    Jaz
     
  13. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Thanks for the info Jaz. That makes a little more sense.
     
  14. mdweb

    mdweb Member
    PartnerNOC

    Joined:
    Nov 23, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Memory

    How do you increase the memory allocated to Tomcat without it upsetting cPanel?

    Currently it is at 64MB.
     
Loading...

Share This Page