Java thread problems on Redhat 9

From: Mark Cohen (mcohen_at_nextag.com)
Date: 09/30/03

  • Next message: Tony Pagliocco: "RE: I can't boot Windows XP with Grub loader."
    To: "'redhat-list@redhat.com'" <redhat-list@redhat.com>
    Date: Tue, 30 Sep 2003 10:22:01 -0700
    
    

    Greetings Gurus,

    We're seeing a strange behavior with redhat 7.3 vs 9

    Running a Java process to create tons of threads and count them per second
    yields poor response times from Redhat 9 running kernel 2.4.20-20.9

    On a dual Xeon P3 1.4 GHz Dell 1650 with 4 gigs of ram we can get 16000
    threads per second.

    On a dual Xeon P4 3.0 GHz Dell 1750 with 4 gigs of ram we see 8000 threads
    per second.

    We made the modifications to glib on the 1650, but that was with the
    linuxthrads library on the 1750 (Native Linux Posix Threads) we just upped
    /proc/sys/kernel/threads-max

    But we see no improvements..

    No matter what we do, we can't break the 10k threads/sec limit on the 1750.

    Here is a copy of the java code we're using...

    public class TestMonitor {
     
            static int sCount = 0;
     
            public static void main(String[] args) {
                    Thread t = new Thread(new Runnable() {
                            public void run() {
                    Object mon = new Object();
                    int count2 = 0;
                    int n = 0;
                    while(true) {
                            if(count2 >= 1000) {
                                    ++sCount;
                                    count2 = 0;
                            }
                            synchronized(mon) {
                                    ++n;
                                    ++count2;
                            }
                    }
                            }
                    });
                    t.start();
                    long time = System.currentTimeMillis();
                    while(true) {
                            try {
                                    Thread.sleep(5000);
                            }
                            catch(Exception ex) {}
                            System.out.println("count = " + sCount + "; " +
    ((double)sCount /
                                    (System.currentTimeMillis() - time) * 1000)
    + " per sec");
                    }
            }
    };

    Any help would be appreciated.

    -Mark

    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Tony Pagliocco: "RE: I can't boot Windows XP with Grub loader."