Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JBoss virtual host issues and multicore processor

 
Shivaprasad P Kanaganahallimath
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are in the process of moving to new server infrastructure

details:
  • Intel Xeon quad core
  • -2 CPUs
  • RAM 8GB
  • swap 4GB


  • We have hosted two websites and two applications on a single JBoss AS 5.1 server [virtual hosting]. 2 applications hosted on a single IP [virtual host] and one website with another IP[ localhost] and one more website with another IP[virtual host - a simple website with static pages]


    so far so good....



    When it comes to the performance of the applications, which are running under virtual hosts are very slower compared to the websites running in localhost and virtual host.

    1.Is this a problem with JBoss configuration or it has something to do with firewall settings of the IP?

    coz the primary IP, i.e. localhost is loading faster but virtual hosted applications are very slow and the other IP address were added later to our server.

    2.How to specify/inform the JBoss/JVM about the availability of the multiple processors?
    I have used -XX:ParallelGCThreads=8 is this enough are something more has to be done?

    Please suggest me some workaround for these issues.
     
    Kees Jan Koster
    JavaMonitor Support
    Rancher
    Posts: 251
    5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Dear Shiva,

    # 1) It is my experience that applications in virtual hosts tend to run slower because they share the disks, causing the applications to be I/O bound.

    You can check this is the case by measuring the performance in one virtual machine with the other one shut down. If there is a large difference, your VM's are competing for resources and thus slowing eachother down.

    # 2) Java is quite capable of finding out about the cores you have in your machine. Old Java versions required the -server flag to use more than one core, but newer versions will automatically pick up and use all cores.

    The switch you set is a tunable of the garbage collector and it is one I would not futz with unless I know precisely what I am doing. So please remove that flag and use -server instead.

    IP addresses never influence performance, unless the TCP configuration is screwed up, causing time-outs. This should lead to error messages, not to slow response times.
     
    Peter Johnson
    author
    Bartender
    Posts: 5852
    7
    Android Eclipse IDE Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Regarding question #2:

    You don't have to do anything. Or maybe you do - you never said which operating system you are using. So I'll assume Windows or Linux. By default, the OS lets any app use any processor. If the app runs multiple threads (like all Java apps do), then you will find those threads on all of the processors. Sometimes this is not a good thing because of L2 cache thrashing issues, in which case you are better off restricting a Java app to use only 2 or 4 CPUs. But only performance testing will uncover what the best number of CPUs is to allocate to a Java app. JBoss in Action, chapter 14, section 14.4 goes into this in some detail.

    The ParallelGCThreads option is for how many garbage collection threads the JVM should use. By default, the JVM allocates 1 GC thread for each CPU (core) up to 8 CPUs, after which it allocates 5 threads for every 8 additional CPUs. Since you have 8 cores, you are already getting 8 GC threads.
     
    Kees Jan Koster
    JavaMonitor Support
    Rancher
    Posts: 251
    5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Dear Peter,

    Do you know about how Hyperthreading CPU's relate to this? Is it better to enable Hyperthreading and let Java think there's twice as many cpu's, or give the machine only the actual cpu's to play with?

     
    Shivaprasad P Kanaganahallimath
    Ranch Hand
    Posts: 48
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank you guys for your valuable reply.

    The OS used in our servers is RedHat Linux with 64bit edition

    uname -a

    Linux test.ussntc19.savvis.net 2.6.18-53.1.13.el5 #1 SMP Mon Feb 11 13:27:27 EST 2008 x86_64 x86_64 x86_64 GNU/Linux


    cat /proc/cpuinfo


    and the java installed is 1.6 64-bit
    I will surely go and check the above mentioned chapter in JBoss in Action.....


     
    Peter Johnson
    author
    Bartender
    Posts: 5852
    7
    Android Eclipse IDE Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Do you know about how Hyperthreading CPU's relate to this?


    It depends on the app. Usually you can see some performance gain, say 15-20%, by turning on hyperthreading. But when using hyperthread you have to be very careful if you set processor affinity - restricting the Java app to running on only hyperthreaded cores can cause great pain. What makes matters worse is that there is no easy way to identify how the affinity mask maps to the cores (though I have not recently googled for a tool to help in that).
     
    Shivaprasad P Kanaganahallimath
    Ranch Hand
    Posts: 48
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi all,


    Actually there was not much of delay in loading the applications. In fact the applications were loading very slow coz of the internet security enabled in my system.
    So once I disabled the Kaspersky internet security, applications started loading very fast (3 seconds max).



    thanks to all of you for all your support.....



    regards
    Shivaprasad P.K.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic