aspose file tools*
The moose likes JBoss/WildFly and the fly likes JBoss virtual host issues and multicore processor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss virtual host issues and multicore processor " Watch "JBoss virtual host issues and multicore processor " New topic
Author

JBoss virtual host issues and multicore processor

Shivaprasad P Kanaganahallimath
Ranch Hand

Joined: Sep 25, 2006
Posts: 48
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.

    Shiva Prasad P.K.
    Kees Jan Koster
    JavaMonitor Support
    Rancher

    Joined: Mar 31, 2009
    Posts: 251
        
        5
    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.


    Java-monitor, JVM monitoring made easy <- right here on Java Ranch
    Peter Johnson
    author
    Bartender

    Joined: May 14, 2008
    Posts: 5827
        
        7

    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.


    JBoss In Action
    Kees Jan Koster
    JavaMonitor Support
    Rancher

    Joined: Mar 31, 2009
    Posts: 251
        
        5
    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

    Joined: Sep 25, 2006
    Posts: 48
    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

    Joined: May 14, 2008
    Posts: 5827
        
        7

    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

    Joined: Sep 25, 2006
    Posts: 48
    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.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: JBoss virtual host issues and multicore processor