<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic High percentage of processes blocked on STREAMS in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213621#M570929</link>
    <description>Hi,&lt;BR /&gt; &lt;BR /&gt;it's still this performance drain that we are trying to trace.&lt;BR /&gt;We looked at all sorts of resource consumption that could manifest as possible performance bottlenecks.&lt;BR /&gt;But couldn't find evidence for a real performance bottleneck on behalf of the server nor the network.&lt;BR /&gt;So I've come to the conclusion that it must be due to badly managed IPC on behalf of the application.&lt;BR /&gt;What puzzles me is that the overwhelming wait reason for processes ist STREAMS.&lt;BR /&gt;I first had to look at knowledge base to find out what actually was meant by STRMS, where I discovered this interesting paper&lt;BR /&gt; &lt;BR /&gt;&lt;A href="http://www4.itrc.hp.com/service/cki/docDisplay.do?hpweb_printable=true&amp;amp;docLocale=en_US&amp;amp;admit=-938907319+1078851566775+28353475&amp;amp;docId=200000066917792" target="_blank"&gt;http://www4.itrc.hp.com/service/cki/docDisplay.do?hpweb_printable=true&amp;amp;docLocale=en_US&amp;amp;admit=-938907319+1078851566775+28353475&amp;amp;docId=200000066917792&lt;/A&gt;&lt;BR /&gt; &lt;BR /&gt;There I got my assumption confirmed that mainly IPC via BSD sockets was meant&lt;BR /&gt;(or maybe to be more precise API calls of the HP-UX STREAMS transport layer interface, viz. to those functions listed in /opt/perf/lib/mikslp.text)&lt;BR /&gt; &lt;BR /&gt;In the paper it says that a high percentage of STRMS block reasons may not necessarily mean that one has a network bottleneck, but could mean that one has lots of IPC over sockets.&lt;BR /&gt; &lt;BR /&gt;My question now is if I can pass the buck to the application developers/implementers to have a closer look at why their procs are being blocked.&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;To give you an impression.&lt;BR /&gt;Right now, a sample taken with glance, while the peak of connections is already over, reveals some 79% of procs blocked on STRMS.&lt;BR /&gt; &lt;BR /&gt;# cat yyy&lt;BR /&gt;print gbl_stream_wait_pct, gbl_pri_wait_pct&lt;BR /&gt;# glance -adviser_only -syntax yyy -j 10 -iterations 10 2&amp;gt;/dev/null&lt;BR /&gt;  78.8   0.0&lt;BR /&gt;  78.9   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.6   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.6   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;</description>
    <pubDate>Tue, 09 Mar 2004 12:43:10 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2004-03-09T12:43:10Z</dc:date>
    <item>
      <title>High percentage of processes blocked on STREAMS</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213621#M570929</link>
      <description>Hi,&lt;BR /&gt; &lt;BR /&gt;it's still this performance drain that we are trying to trace.&lt;BR /&gt;We looked at all sorts of resource consumption that could manifest as possible performance bottlenecks.&lt;BR /&gt;But couldn't find evidence for a real performance bottleneck on behalf of the server nor the network.&lt;BR /&gt;So I've come to the conclusion that it must be due to badly managed IPC on behalf of the application.&lt;BR /&gt;What puzzles me is that the overwhelming wait reason for processes ist STREAMS.&lt;BR /&gt;I first had to look at knowledge base to find out what actually was meant by STRMS, where I discovered this interesting paper&lt;BR /&gt; &lt;BR /&gt;&lt;A href="http://www4.itrc.hp.com/service/cki/docDisplay.do?hpweb_printable=true&amp;amp;docLocale=en_US&amp;amp;admit=-938907319+1078851566775+28353475&amp;amp;docId=200000066917792" target="_blank"&gt;http://www4.itrc.hp.com/service/cki/docDisplay.do?hpweb_printable=true&amp;amp;docLocale=en_US&amp;amp;admit=-938907319+1078851566775+28353475&amp;amp;docId=200000066917792&lt;/A&gt;&lt;BR /&gt; &lt;BR /&gt;There I got my assumption confirmed that mainly IPC via BSD sockets was meant&lt;BR /&gt;(or maybe to be more precise API calls of the HP-UX STREAMS transport layer interface, viz. to those functions listed in /opt/perf/lib/mikslp.text)&lt;BR /&gt; &lt;BR /&gt;In the paper it says that a high percentage of STRMS block reasons may not necessarily mean that one has a network bottleneck, but could mean that one has lots of IPC over sockets.&lt;BR /&gt; &lt;BR /&gt;My question now is if I can pass the buck to the application developers/implementers to have a closer look at why their procs are being blocked.&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;To give you an impression.&lt;BR /&gt;Right now, a sample taken with glance, while the peak of connections is already over, reveals some 79% of procs blocked on STRMS.&lt;BR /&gt; &lt;BR /&gt;# cat yyy&lt;BR /&gt;print gbl_stream_wait_pct, gbl_pri_wait_pct&lt;BR /&gt;# glance -adviser_only -syntax yyy -j 10 -iterations 10 2&amp;gt;/dev/null&lt;BR /&gt;  78.8   0.0&lt;BR /&gt;  78.9   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.6   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.6   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;  78.7   0.0&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Mar 2004 12:43:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213621#M570929</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-03-09T12:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: High percentage of processes blocked on STREAMS</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213622#M570930</link>
      <description>Hi Ralph:&lt;BR /&gt;&lt;BR /&gt;There is still not enough data for a definitive answer. This may be perfectly normal behavior. Your cooperating processes may be sending large numbers of rather small packets each waiting for the other to complete some task. Yours is a prime example of why I insist that the developers work on someold sluggish boxes. That way, potentially poor designs manifest themselves before they are discovered only on production boxes. This would be my test: Intentinally throttle your (I assume 100MB or Gigabit) down to 10MB. Make sure this is done on both ends of each connection. Now your developers (I'm sure they are blaming the hardware/network/tuning) will tell you that that will tremendously slow you down (10X if we assume a 100MB to 10MB decrease) but I am willing to bet that the actual slowdown will be extremely small. If so, the network is not the bottleneck but rather the software protocol is the more likely suspect.&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Mar 2004 13:02:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213622#M570930</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-03-09T13:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: High percentage of processes blocked on STREAMS</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213623#M570931</link>
      <description>Ralph,&lt;BR /&gt;&lt;BR /&gt;As you already discovered, this doesn't mean a network bottleneck itself. I treat it just like disk IO where the process waits on it's request to complete. In case of sockets, they show as blocked on streams instead showing as sleeping. I would first understand the nature of transactions my system does before going to the developers.&lt;BR /&gt;&lt;BR /&gt;If there is a network bottleneck, then it would be reflected it in the GBL_NETWORK_ERR* and GBL_NETWORK_SUBSYSTEM_QUEUE and BYNETIF* metrics. &lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Mar 2004 13:51:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213623#M570931</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-03-09T13:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: High percentage of processes blocked on STREAMS</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213624#M570932</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt; Here is some data on Glance and the Block On Streams message. As stated in the earlier posts this is not indicating a network bottleneck but typically an application issue. Good Luck, hope this helps. &lt;BR /&gt;&lt;BR /&gt;Global and Process Blocked States:&lt;BR /&gt;&lt;BR /&gt;   On hpux 11.X glanceplus assigns a wait state to a process&lt;BR /&gt;   using a textfile /opt/perf/lib/mikslp.text which provides a&lt;BR /&gt;   translation between the specific kernel routine that caused the&lt;BR /&gt;   process to last change its state and the wait state which will&lt;BR /&gt;   be assigned to the process.  The global wait states are simply&lt;BR /&gt;   the sum of the individual process wait states.  Therefore, the&lt;BR /&gt;   sum of all the processes blocked on streams as a percentage of&lt;BR /&gt;   the total number of processes on the system gives the % blocked&lt;BR /&gt;   on streams as a global wait state.&lt;BR /&gt;&lt;BR /&gt;   The GlancePlus Help subsystem in both glance and GPM provides&lt;BR /&gt;   help on this metric (GBL_STREAM_WAIT_PCT).&lt;BR /&gt;&lt;BR /&gt;   The definition states the following:&lt;BR /&gt;&lt;BR /&gt;     "The percentage of time processes or threads were blocked&lt;BR /&gt;      on streams IO (waiting for a streams IO operation to&lt;BR /&gt;      complete) during the interval.&lt;BR /&gt;&lt;BR /&gt;      This is calculated as the accumulated time that all&lt;BR /&gt;      processes or threads spent blocked on STRMS (that is,&lt;BR /&gt;      streams IO) divided by the accumulated time that all&lt;BR /&gt;      processes or threads were alive during the interval..."&lt;BR /&gt;&lt;BR /&gt;   So to start with we are looking at a global metric that buckets&lt;BR /&gt;   all the individual process and thread wait states when they are&lt;BR /&gt;   blocked on STREAMS.&lt;BR /&gt;&lt;BR /&gt;   Basically we sum wait state values of all running threads and&lt;BR /&gt;   processes during each measurement interval.&lt;BR /&gt;&lt;BR /&gt;   So the interesting component now becomes the individual thread&lt;BR /&gt;   and process wait state for being blocked on streams.&lt;BR /&gt;&lt;BR /&gt;   GlancePlus also collects this data in the metrics&lt;BR /&gt;   PROC_STREAM_WAIT_PCT and THREAD_STREAM_WAIT_PCT.  The definitions&lt;BR /&gt;   of these metrics simply state that they represent the percentage&lt;BR /&gt;   of time that a process or thread was blocked on streams IO.&lt;BR /&gt;&lt;BR /&gt;   All the data that glance collects on process and thread wait&lt;BR /&gt;   states is either via kernel instrumentation or by calls to&lt;BR /&gt;   pstat().&lt;BR /&gt;&lt;BR /&gt;B. Blocked on Streams:&lt;BR /&gt;&lt;BR /&gt;   Since the old 10.20 'blocked on SOCKET' has now transferred&lt;BR /&gt;   to the stream IO subsystem, perhaps it may be useful to revisit&lt;BR /&gt;   what blocked on socket means.&lt;BR /&gt;&lt;BR /&gt;   A socket wait does not mean there is a network bottleneck.&lt;BR /&gt;   Programs using socket communication will spend a large chunk&lt;BR /&gt;   of their time blocked on socket, due to the nature of sockets.&lt;BR /&gt;   Only one side can have access at a time, and the size of the&lt;BR /&gt;   socket is only 8k.  This means if you have two processes&lt;BR /&gt;   communicating, one of them will always be blocked on socket&lt;BR /&gt;   waiting for the other one to get done.&lt;BR /&gt;&lt;BR /&gt;   Also, rather then blocking on SLEEP when it is waiting for the&lt;BR /&gt;   next request, it will block on the socket looking for the data&lt;BR /&gt;   that will appear.&lt;BR /&gt;&lt;BR /&gt;   This is the important point:  The wait state of streams may&lt;BR /&gt;   simply be indicating that processes (or threads) are&lt;BR /&gt;   conducting IPC and waiting (listening) on a socket (or it's&lt;BR /&gt;   streams replacement) for some data.  Where IPC is involved&lt;BR /&gt;   it becomes very difficult to know if the wait state is due&lt;BR /&gt;   to some sort of system wide resource shortage, or if it is&lt;BR /&gt;   simply normal IPC for the applications involved.&lt;BR /&gt;&lt;BR /&gt;   There is a good chance that a system showing a large amount&lt;BR /&gt;   of time blocked on streams is simply running an application&lt;BR /&gt;   that is IPC intensive.  As with most System V IPC mechanisms,&lt;BR /&gt;   it is better to make sure that there are adequate (or better)&lt;BR /&gt;   values for such kernel parameters than to suffer a shortage.&lt;BR /&gt;&lt;BR /&gt;   One simple test to prove a point would be for an adiminstrator who&lt;BR /&gt;   is experiencing a high value for GBL_STREAMS_WAIT_PCT to run glance&lt;BR /&gt;   prior to starting up an application (perhaps after a reboot or&lt;BR /&gt;   scheduled maintenance).  The value will probably remain low until&lt;BR /&gt;   the application comes up.&lt;BR /&gt;&lt;BR /&gt;   All the data that Glance collects on process and thread wait&lt;BR /&gt;   states, is via kernel instrumentation or by calls to 'pstat()'.&lt;BR /&gt;&lt;BR /&gt;   NOTE:  The following is an excerpt from /opt/perf/lib/mikslp.text.&lt;BR /&gt;          It is a list of specific kernal routines that relate to the&lt;BR /&gt;          state of 'blocked on streams' in Glance:&lt;BR /&gt;&lt;BR /&gt;          str_sched_up_daemon             BLOCKED_STREAM&lt;BR /&gt;          str_sched_mp_daemon             BLOCKED_STREAM&lt;BR /&gt;          str_sched_blk_daemon            BLOCKED_STREAM&lt;BR /&gt;          str_mem_daemon                  BLOCKED_STREAM&lt;BR /&gt;          str_weld_daemon                 BLOCKED_STREAM&lt;BR /&gt;          read_sleep                      BLOCKED_STREAM&lt;BR /&gt;          hpstreams_read_tty              BLOCKED_STREAM&lt;BR /&gt;          write_sleep                     BLOCKED_STREAM&lt;BR /&gt;          getmsg                          BLOCKED_STREAM&lt;BR /&gt;          getpmsg                         BLOCKED_STREAM&lt;BR /&gt;          putmsg                          BLOCKED_STREAM&lt;BR /&gt;          putpmsg                         BLOCKED_STREAM&lt;BR /&gt;          runq_remove                     BLOCKED_STREAM&lt;BR /&gt;          _csq_acquire                    BLOCKED_STREAM&lt;BR /&gt;          streams_mpsleep                 BLOCKED_STREAM&lt;BR /&gt;          hpstreams_close_int             BLOCKED_STREAM&lt;BR /&gt;          hpstreams_write_int             BLOCKED_STREAM&lt;BR /&gt;          ioctl_sleep                     BLOCKED_STREAM&lt;BR /&gt;          str_istr_ioctl                  BLOCKED_STREAM&lt;BR /&gt;          str_plumb_ioctl                 BLOCKED_STREAM&lt;BR /&gt;          str_head_ioctl                  BLOCKED_STREAM&lt;BR /&gt;          str_trans_ioctl                 BLOCKED_STREAM&lt;BR /&gt;          str_async_ioctl                 BLOCKED_STREAM&lt;BR /&gt;          str_alive_ioctl                 BLOCKED_STREAM&lt;BR /&gt;          str_socket_ioctl                BLOCKED_STREAM&lt;BR /&gt;          hpstreams_option1               BLOCKED_STREAM&lt;BR /&gt;          str_tty_ioctl                   BLOCKED_STREAM&lt;BR /&gt;          streams_poll                    BLOCKED_STREAM&lt;BR /&gt;          streams_poll1                   BLOCKED_STREAM&lt;BR /&gt;          osr_run                         BLOCKED_STREAM&lt;BR /&gt;          osr_close_subr                  BLOCKED_STREAM&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Mar 2004 08:39:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213624#M570932</guid>
      <dc:creator>Todd Whitcher</dc:creator>
      <dc:date>2004-03-10T08:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: High percentage of processes blocked on STREAMS</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213625#M570933</link>
      <description>You might take some tusc traces of the application(s) and examine those - might be best to make them verbose traces with timestamps and printing of pid and lwpid.&lt;BR /&gt;&lt;BR /&gt;Before you go there, you might look at process system calls in glance ("L" IIRC)&lt;BR /&gt;&lt;BR /&gt;Also examine your netstat statistics.  You may find beforeafter useful there:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="ftp://ftp.cup.hp.com/dist/networking/tools/" target="_blank"&gt;ftp://ftp.cup.hp.com/dist/networking/tools/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and then &lt;BR /&gt;&lt;BR /&gt;&lt;A href="ftp://ftp.cup.hp.com/dist/networking/briefs/annotated_netstat.txt" target="_blank"&gt;ftp://ftp.cup.hp.com/dist/networking/briefs/annotated_netstat.txt&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Mar 2004 13:58:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/high-percentage-of-processes-blocked-on-streams/m-p/3213625#M570933</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2004-03-10T13:58:21Z</dc:date>
    </item>
  </channel>
</rss>

