Increasing socket muxer threads

Hello,
Had production performance issue today that was resolved by creating an execute queue with 200 threads and placing the offending servlet on that queue.
However, I noticed that the socket muxer with 3 threads is constantly busy. Is there any way to increase the number of threads for the muxer, or is this not a concern? Is it different if we are using native socket muxer? Have read several docs but still have no clear answer if we should be concerned about socket muxer.
Thanks,
Rich

Thanks,
I'm familiar with that parameter. However, from some docs I got the, probably confused, impression that those are non-native (java?) threads, and that the socket readers parameter didn't have much to do with anything once you started using the native-io performance pack.
Thanks again,
Rich

Similar Messages

  • RE:Socket muxer threads

    i am facing the issue where thread dump shows that Socket muxer threads are blocked where i am getting the load average as 3.5 and GCs are 4sec i am using the Sun JVM 1.5_19 and RHEL 5 does JVM upgradation bring the load average and GCs down
    Thanks
    Karan

    i can see the lot of parallel nursery GC and then occasionally Full GCs that is good actually as the processor would be with the application for most of the time it is clearing almost 800MB at the Full GC but we are seeing 4sec GC on an average and the loadaverage is above 4 we have 4cpus i think the loadaverage is acceptable as it 4*1.1 =4.4 but the response time is higher we want it to bring down is there anyway we can bring the GC we are using the parallel GC with Sun JVM 1.5_19
    Thanks
    Karan

  • Implementing sockets and threads in a jframe gui program

    Hi, I am trying to find a solution to a problem I am having designing my instant messenger application.
    I am creating listening sockets and threads for each client logged into the system. i want to know if there is a way to listen to other clients request from the main gui and then if another client tries to establish a connection with me for example, a thread is created for that client and then my chat gui opens automatically has soon has the other client sends his or hers first text message to me.
    I am relatively new at socket programming has I am currently studying along this area. I know how to create threads and sockets but I am having trouble finding out a solution to my problem. Here is the code that I have done so far for the listening method from my main gui, and the thread class of what I have done so far.
    listening socket:
         private void listeningSocket()
                ServerSocket serverSocket = null;
                boolean listening = true;
                try
                    //listen in port 4444;
                    serverSocket = new ServerSocket(4444);
                catch(IOException x)
                    JOptionPane.showMessageDialog(null, "cannot listen to port 4444", null, JOptionPane.ERROR_MESSAGE);
                while(listening)
                    client_thread w;
                    try
                       w = new client_thread(serverSocket.accept(), jTextArea1);
                       Thread t = new Thread(w);
                       t.start();
                    catch(IOException x)
                         JOptionPane.showMessageDialog(null, "error, cannot start new thread", null, JOptionPane.ERROR_MESSAGE);
            }thread class:
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    import java.sql.*;
    import java.awt.event.*;
    * @author jonathan
    public class client_thread extends Thread
         //define new socket object
        private Socket client_user = null;
        private JTextArea textArea;
        public client_thread(Socket client_user, JTextArea textArea)
            this.client_user = client_user;
            this.textArea = textArea;
        public void run()
            BufferedReader in = null;
            PrintWriter out = null;
            String error = "error has occured, messege was not sent";
            String messege = null;
             try
                //create input and output streams
                in = new BufferedReader(new InputStreamReader (client_user.getInputStream()));
                out = new PrintWriter(client_user.getOutputStream(), true);
                while(true)
                   //read messege sent by user
                   messege = in.readLine();
                    //display messege in textfield
                   out.println(messege);
                   textArea.append(messege);
            catch (IOException e)
                //error messege
                JOptionPane.showMessageDialog(null, error, null, JOptionPane.ERROR_MESSAGE);
    }

    Seems like all you need to do is create a new dialog for each socket that is established. Your current design looks like it will attempt to use the same textarea for all the sockets.
    I would say in your thread class do the following:
    MyConversationDialog dialog = new MyConversationDialog();
    while(true)
                   //read messege sent by user
                   messege = in.readLine();
                    //display messege in textfield
                   out.println(messege);
                   dialog.setVisible (true);
                   dialog.addMessage (message);
                }

  • Increase the JDBC Thread count

    All,
    Please let me know how to increase the Max thread count for JDBC adapter from 5 to 10 and let us know if there are any impact on the performence.
    JDBC_http://sap.com/xi/XI/System.Call.maxConsumers 5
    JDBC_http://sap.com/xi/XI/System.Recv.maxConsumers 5
    JDBC_http://sap.com/xi/XI/System.Rqst.maxConsumers 5
    JDBC_http://sap.com/xi/XI/System.Send.maxConsumers 5
    Please help me in this regard.
    Thanks in advance.
    Gary

    hi check the below links:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/806e75a0-0e01-0010-2587-fc518de8ac1a
    admin manual:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/fdb09490-0201-0010-e09e-a76388646ad0
    note:reward points if solution found helpfull.....
    regards
    chandrakanth.k

  • Nasty memory leak using sockets inside threads

    In short, any time I create or use a socket inside a worker thread, that Thread object instance will never be garbage collected. The socket does not need to be connected or bound, it doesn't matter whether I close the socket or not, and it doesn't matter whether I create the Socket object inside the thread or not. As I said, it's nasty.
    I initially encountered this memory leak using httpclient (which creates a worker thread for every connect() call), but it is very easy to reproduce with a small amount of stand-alone code. I'm running this test on Windows, and I encounter this memory leak using the latest 1.5 and 1.6 JDK's. I'm using the NetBeans 5.5 profiler to verify which objects are not being freed.
    Here's how to reproduce it with an unbound socket created inside a worker thread:
    public class Test {
         public static class TestRun extends Thread {
              public void run() {
                   new Socket();
         public static void main(String[] strArgs) throws Exception {
              for(;;) {
                   (new TestRun()).start();
                   Thread.sleep(10);
    }Here's how to reproduce it with a socket created outside the thread and used inside the worker thread:
    public class Test {
         public static class TestRun extends Thread {
              Socket s;
              public TestRun(Socket s) { this.s = s; }
              public void run() {
                   try {
                        s.bind(new InetSocketAddress(0));
                        s.close();
                   } catch(Exception e) {}
         public static void main(String[] strArgs) throws Exception {
              for(;;) {
                   (new TestRun(new Socket())).start();
                   Thread.sleep(10);
    }Here's how to reproduce it implementing Runnable instead of extending Thread:
    public class Test {
         public static class TestRun implements Runnable {
              public void run() {
                   Socket s = new Socket();
                   try { s.close(); } catch(Exception e) {}
         public static void main(String[] strArgs) throws Exception {
              for(;;) {
                   (new Thread(new TestRun())).start();
                   Thread.sleep(10);
    }I've played with this a lot, and no matter what I do the Thread instance leaks if I create/use a socket inside it. The Socket instance gets cleaned up properly, as well as the TestRun instance when it's implementing Runnable, but the Thread instance never gets cleaned up. I can't see anything that would be holding a reference to it, so I can only imagine it's a problem with the JVM.
    Please let me know if you can help me out with this,
    Sean

    Find out what is being leaked. In the sample programs, add something like this:
        static int loop_count;
            while (true) {
                if (++count >= 1000) {
              System.gc();
              Thread.sleep(500); // In case gc is async
              System.gc();
              Thread.sleep(500);
              System.exit(0);
            }Then run with java -Xrunhprof:heap=sites YourProgram
    At program exit you get the file java.hprof.txt which contains something like this towards the end of the file:
              percent          live          alloc'ed  stack class
    rank   self  accum     bytes objs     bytes  objs trace name
        1  0.47%  0.47%       736    5       736     5 300036 char[]
        2  0.39%  0.87%       616    3       616     3 300000 java.lang.Thread
        3  0.30%  1.17%       472    2       472     2 300011 java.lang.ThreadLocal$ThreadLocalMap$Entry[]
        4  0.27%  1.43%       416    2       416     2 300225 java.net.InetAddress$Cache$Type[]See, only three live Thread objects (the JVM allocates a few threads internally, plus there is the thread running main()). No leak there. Your application probably has some type of object that it's retaining. Look at "live bytes" and "live objs" to see where your memory is going. The "stack trace" column refers to the "TRACE nnnnn"'s earlier in the file, look at those to see where the leaked objects are allocated.
    Other quickies to track allocation:
    Print stats at program exit:
    java -Xaprof YourProgram
    If your JDK comes with the demo "heapViewer.dll" (or
    heapViewer.so or whatever dynamic libraries are called on your system):
    java -agentpath:"c:\Program Files\Java\jdk1.6.0\demo\jvmti\heapViewer\lib\heapViewer.dll" YourProgram
    Will print out statistics at program exit or when you hit Control-\ (Unix) or Control-Break (Windows).

  • How do you manually set the # of threads - weblogic.socket.Muxer in 8.1

    We are seeing some strange behavior with an application that has 9 threads as seen in the "Monitor all Active Queues..." I'd like to try to reduce this to 5, where would I set this?
    Thanks!

     Just Google for such things as this: http://www.directron.com/12to7.html
     You can also rig things yourself if you're inclined to do so and have the ability. You can finds instuctions by doing a web search.
     I made something a bit different using a +8V 0.5A voltage regulator just because I had the parts and felt like doing it.

  • Problem with socket and Threads

    Hi,
    I have coded a package that sends an sms via a gateway.
    Here is what is happening:
    * I create a singleton of my SMSModule.
    * I create an sms object.
    * I put the object in a Queue.
    * I start a new Thread in my sms module that reads sms from queue.
    * I connect to sms gateway.
    * I send the sms.
    * I disconnect from socket! This is where things go wrong and I get the following error (see below).
    I have a zip file with the code so if you have time to take a look at it I would appreciate it.
    Anyway all hints are appreciated!
    //Mikael
    GOT: !LogoffConf:
    mSIP Kommando var: !LogoffConf
    CoolFlix log: MSIPProtocolHandler;setLoggedin(false)
    We got LogOffConf
    Waiting ......for thread to die
    java.net.SocketException: Socket operation on nonsocket: JVM_recv in
    socket input stream read
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:116)
    at
    sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:405)

    Off the top of my head, probably the garbage collector cleared your SMSModule coz all classes loaded through other classloaders will be unloaded when that classloader is unloaded.
    mail in the code if you want me to look at it with greater detail.

  • Socket and threads.

    I have written a socket client and a socket server. The client sends a directory name and the server sends directory files and their content. The client asks for files every five seconds (it has to be made once every day, but for trials I have reduced the time), so I have written a thread to made the client sleep for that time. The problem appears after looping fifty or sixty times, when the socket, which does not die, stops making its work (files are not send any more). I really thank every answer.

    Please be clear. What "stops work" the client or the server? Can you post the relevant code that is "looping fifty or sixty times"?

  • Stop a socket listening thread?

    Hi all,
    I'm a newbie at java socket programming, and i have a problem in implementing realibility over UDP.
    This is the pseudocode of my program.
    class ChatProtocol
         DatagramSocket socket;
         Thread alwaysListeningSocket;
         public ChatProtocol(parameter)
              // Some setting up
    ]          this.alwaysListeningSocket = this;
         public void run()
              DatagramPacket packet = new DatagramPacket(parameter);
              socket.receive(packet);
              .     // Process the incoming messages
         public void send(message)
              // Chunking the message into datagramPackets[]
              // Thread for listening for acknowledgement for each will-be-sent packets
              Thread ackListener = new Thread(new Runnable()
                   public void run()
                        DatagramPacket ackPacket = new DatagramPacket(parameter);
                        socket.receive(ackPacket);
                        .     // Processing the acknowledgement
              ackListener.start(); // Start listening for ack
              for (int i = 0; i < datagramPackets.length; i++)
                   socket.send( datagramPacktes[i] );
              .     // Another process
    }I have an always listening socket in my program, which is done by invoking socket.receive() inside a thread
    And i have a send method, which will send messages thorugh the same socket.
    The problem is, i have to listen for acknowledgement for each sent packets through the same socket.
    This is done by invoking socket.receive(), but if i want to invoke this method, i have to stop the previous thread first.
    Is this possible, since stop() method in Thread class is deprecated?

    So you can't predict the ordering of ACKs and other messages. You can't even predict the ordering of ACKs even if there are np other messagesI have a sequence number put into the datagram packets.
    This is the format of my packets.
    Packet length 16 bytes, consist of :
    - Packet type, 1 byte (This will determine if the packets is a message or an ack).
    - Sequence number, 1 byte.
    - Payload 14 bytes.
    If the receiving socket receive a wrong type of packets (ack instead of message, vica versa), the receiver thread will just drop it.
    And in both cases why start another thread to receive the ACK instead of receiving it in the thread that did the send()? This makes even less sense.By 'receiving it in the thread that did the send()', do you mean that i should put it in the send() method block?
    I pressume that an ack may come before the process finish sending the messages. I put it into a thread so that the process can receive ack while sending another messages.
    It is not important though, because the number of packets that will be sent is relatively small. Should i just change it?
    So, rethink. I would say that your always-listening socket should listen in a single thread for all messages, and notify sending threads about the acknowledgements some other way, e.g. via some data structure. You need that anyway to overcome the lack of ordering among ACKs. You need to associate each sent message that has an ACK outstanding with the thread that sent it, and when it arrives, notify that thread; have the sending thread wait(), almost certainly with a timeout, for that notification, and resend if necessary, adjusting the data structure appropriately so that a late ACK to the previous send is ignored. Or whatever is appropriate to your application protocol.I'll try to redesign my protocol. Thanks for the tips !
    I'm not very good at English. Sorry if i misunderstood you in some way.

  • Socket stucking thread and program

    Hi!
    I have an applet that updates itself through a sockets thread .
    The thread objects is being called in the init() method ,
    for some reason in the constructor of the thread the program doesnt pass the line :
    in=new ObjectInputStream(new BufferedInputStream(s.getInputStream()));
    s is the socket .
    The most wierd thing is , that this line stucks the thread , that stucks the applet , which is a wierd concept-its a thread !!!
    What can it be ?

    Let me guess. You have this:
    in=new ObjectInputStream(new BufferedInputStream(s.getInputStream()));
    out=new ObjectOutputStream(new BufferedOutputStream(s.getOutputStream()));in both your client and your server. Try it this way:
    out=new ObjectOutputStream(new BufferedOutputStream(s.getOutputStream()));
    in=new ObjectInputStream(new BufferedInputStream(s.getInputStream()));EJP

  • Increasing number of Threads in the Thread Pool

    Hi,
    Using newFixedThreadPool ( int nbThreads )_, how do I increase the number of threads allowed dynamically in my application ?
    Thank you

    As the name of the method implies the Pool returned by that method supports only a fixed number of threads.
    If you want to be able to modify the number of threads after instantiation, then you could use a ThreadPoolExecutor. This class supports changing the number of threads it uses.

  • Monitor socket with thread in WebLogic

    I've recently joined a company where a solution was put in place within web apps to monitor a socket. The socket communication comes from a C-based app sending in messages to a socket monitored by a thread.
    This was done in a web app that used WebLogic Express, with only JSP's and servlets. My question is...how appropriate is this architecture in a WebLogic server that will now call EJB's from this thread? How can I spawn this thread outside of a servlet, maybe a startup class? My services layer may receive RMI-based client calls, thus the servlet would not come into play.
    My thoughts are that this should become a JMS-based communication, but for the initial versions, we may not have time rehaul the messaging infrastructure.
    I'd appreciate any opinions on this....
    Chuck

    <p>cheinle,</p>
    <p>It's not clear from your post what it is you need to achieve. What protocol is your service layer using? Is your service layer <b>only</b> going to deal with synchronous RMI requests?</p>
    <p>Answering your first question the implementation you describe using WebLogic Express is also applicable to WebLogic.</p>
    <p>With respect to Servlets and EJBs a typical architecture would have HTTPServlets listen on a ServerSocect and dispatch requests to a service layer implemented in EJBs (in their own threads). You could implement your own Servlets to deal to with protocols other than HTTP.</p>
    <p>You can also provide an HTTP wrapper for your RMI service layer using servlets see here for an introduction to using HTTPServlets with RMI</p>
    <p>cheers</br>
    Hussein Badakhchani</br>
    www.orbism.com
    </p>

  • Increase no. of thread in JDK1.4

    Hi all, is there any way to increase the number of java threads? I have written a java program to create 1000 of java threads but it will throw the following error when up to about 800 of java threads.
    Error message:
    Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
    I have checked my cpu and memory usage was very low even I have created about 800 of java threads
    Can anyone help me? Thanks!!
    Here is my pc configuration:
    CPU: PIII 800MHz x 2
    RAM: 512MB
    OS: linux-2.4.9-13
    JVM: j2sdk-1.4.0 beta 3
    Here is my java program
    public class BThread extends Thread {
    private int index=0;
    public BThread(int index) {
    System.out.println(index + " of thread create");
    public void run() {
    while(true) {
    try {
    sleep(1000);
    } catch (InterruptedException e) {
    static public void main(String[] args) {
    int numThread = 1000;
    BThread t[] = new BThread[numThread];
    for(int i=0; i<numThread; i++) {
    t[i] = new BThread(i);
    t.start();

    This is not a function of the number of threads, but a function of the maxsize of the memory allotted in your JVM. Search by error name to see the similar post replies...
    Good Luck,
    -Randall

  • Sockets and thread communication multiplexing?

    Hello,
    I need to implement a server which will have a maximum of 10 clients connected.
    I wanted to go for classic blocking I/O because I won't have much clients.
    My problem is that even if I accept() some sockets and then create a thread for each socket,
    then I still need to communicate some data to the other threads, problem is that I am blocked
    on the read() operation, how could I address this problem?
    I mean, lets say I am thread1 and blocked on read() on my socket, now thread7 wants to tell
    me something like a chat message coming from client he handles, how could thread7 manage
    to wake thread1 and send him a message somehow?
    I do not want to deal with NIO stuff if possible because I do not need to scale, I just have a
    problem because I am stuck on the read.
    I will run on Windows.
    Thanks for help.
    Edited by: Marzullo on Jul 15, 2010 1:05 PM

    Fully answered in [your other thread|http://forums.sun.com/thread.jspa?threadID=5445070&messageID=11020688#11020688].
    Please don't multipost, as it can lead to people wasting their time repeating others' answers.

  • Socket and Thread Explanation

    I'm a little confused on the Socket stuff. I read some tutorials but wanted to make sure I understand. I'm using a simple client/server chat app as a reference.
    First the ServerSocket is just a connection to the port you want to listen on... I understand that. Is the Sockets... Socket s = ss.accept(); a tunnel to the port for data to travel on?
    Second.. When you create a Thread. This is the information that travels on these sockets? If that's the case I understand... But I have one question relating to some chat code I can't quite figure out.
    The simple chat program conists of a ChatServer, ServerThread and a Client.
    in the ChatServer it creates a ServerSocket and later on it looks for new connections for clients and then creates a ServerThread. What the heck is this for. From the code in the ServerThread it just handles incoming data and sends them back out. OK.
    But in the Client... it connects to this port and then creates it's own thread i.e. new Thread(this).start();
    Why ServerThread and then a Thread from the Client... Shouldn't there just be one?
    Sorry, I just can't get this.

    I'm a little confused on the Socket stuff. I read
    some tutorials but wanted to make sure I understand.
    I'm using a simple client/server chat app as a
    reference.
    First the ServerSocket is just a connection to the
    port you want to listen on... I understand that. Is
    the Sockets... Socket s = ss.accept(); a tunnel to
    the port for data to travel on?when the accept() method called, the server socket will start listening to the port for any connection. Once a connection established, this method will return a connected socket.
    >
    Second.. When you create a Thread. This is the
    information that travels on these sockets? If that's
    the case I understand... But I have one question
    relating to some chat code I can't quite figure out.A new thread was created here to that this thread can handle the socket return by the serversocket independenty to the main thread. Mainly server code will do this so that the main thread can continue to listening to other new connection agains while this newly created thread will handle any communication between a connected client and server.
    The simple chat program conists of a ChatServer,
    ServerThread and a Client.
    in the ChatServer it creates a ServerSocket and later
    on it looks for new connections for clients and then
    creates a ServerThread. What the heck is this for.
    From the code in the ServerThread it just handles
    incoming data and sends them back out. OK.
    But in the Client... it connects to this port and then
    creates it's own thread i.e. new Thread(this).start();Well, i dun know how the code for the client look like... but guessing that the client was implements Runnable. So, in the main method, it spawn a new thread and pass this class for this new thread to handle while the main thread maybe continue to do other things or just end after finish.
    >
    Why ServerThread and then a Thread from the Client...
    Shouldn't there just be one?
    Sorry, I just can't get this.Well, hope my explaination was clear enough... :P

Maybe you are looking for

  • Using a variable in an instance name

    Hey all, Simple question: I'm trying to use a variable to call on different instance names: var picCaller:uint=2; material_mc.addChild(pic_""+picCaller+""); The code in red is the issue in question.  In this example, I'm trying to add a child called

  • How do you export multiple photos to the Camera Roll?

    The option to save multiple images to the Camera Roll does not work on my iPad 2. I tap Share, then tap Camera Roll and a list of options shows up. However, the options All and Selected are greyed out. Whatever I tried to do, they stay grey. This is

  • Error when trying to create a new movie in iMovie

    I am currently using a late 2013 MacBook Pro with Retina Display, 2.4 GHz Intel Core i5 processor, 4 GB 1600 Mhz DDr3 Memory, and 121 GB Flash Storage, running OS X Yosemite 10.10.2. I am having issues creating a new movie in my iMovie application (V

  • I have an Adobe Id. How can I download Adobe Media Encoder CC 64bit?

    I can't find a link to download and install Adobe Media Encoder CC 64bit. I can only find a link to update Adobe Media Encoder here: Adobe - Adobe Media Encoder : For Windows

  • Refactoring Behavior Problem?

    I have created 2 applications which are deployed as ADF Jar Libraries. Inside these apps are fragment taskflows which I am using in a master application. When I run the master app, ADF complains that there are 2 references to "view/DataBindings.cpx"