SYS$QIOW - Performance Issue

SYS$QIOW - Performance Issue

Post by Vive » Tue, 27 May 2003 14:54:56



Hi,

I am reading data from the mailbox using the call SYS$QIOW( )

SYS$QIOW reads 1024 bytes in one call.

Mail Box has max buffer of 2048 and message size as 1024.

I am encountering a problem of performance in reading from mail box on VAX
machine, it is also happening on some ALPHA boxes and not on some.

The time taken by this call is 4 minutes to 10 minutes for eac call.

My Query is, if SYS$QIOW is the right call to read message from MAILBOX?

Can I use alternative call to improve performance.

Thanks
Vivek

 
 
 

SYS$QIOW - Performance Issue

Post by Ron Mile » Tue, 27 May 2003 15:24:40


Hi,
    SYS$QIOW should work.  If the message is already in the mailbox then the
call should complete within milliseconds.  The only thing that comes to mind
is that there isn't any message waiting in the mailbox so the QIOW waits
until it gets a message.  The documentation for the mailbox qio read call
can be found at
http://h71000.www7.hp.com/doc/72final/6136/6136pro_013.html#mailbox_c... in
chapter 4.3.1.

Good luck.
Ron Milen


Quote:> Hi,

> I am reading data from the mailbox using the call SYS$QIOW( )

> SYS$QIOW reads 1024 bytes in one call.

> Mail Box has max buffer of 2048 and message size as 1024.

> I am encountering a problem of performance in reading from mail box on VAX
> machine, it is also happening on some ALPHA boxes and not on some.

> The time taken by this call is 4 minutes to 10 minutes for eac call.

> My Query is, if SYS$QIOW is the right call to read message from MAILBOX?

> Can I use alternative call to improve performance.

> Thanks
> Vivek


 
 
 

SYS$QIOW - Performance Issue

Post by JF Meze » Tue, 27 May 2003 16:37:28



> SYS$QIOW reads 1024 bytes in one call.

> Mail Box has max buffer of 2048 and message size as 1024.
> The time taken by this call is 4 minutes to 10 minutes for eac call.

During those minutes, is the process in LEF state ?

If you do SHOW DEV MBAxxx:/full, what is the "Reference Count" ? That shows
how many channels are assigned to it. If you have 2 processes competing for
read operations, this may explain.

With mailboxes and QIO, a message written to the mailbox gets delivered to the
channel who is first in the queue to read a message.

So if you have 2 processes with READ pendings, and a appliaction that expects
one "command" message followed by one "data" message, then process 1 will get
the command message, and process 2 will get the "data message" (when it would
expect a command message), and process 1 then waits for a data message that
should have accompanied the command message.

With QIOW, your process goes into LEF (waiting for event flag to be set) until
the IO completes.
If your process goes into some other state, (especially one starting with
RW___) it means that there is a serious problem.

Does the process which writes to the maibox work normally, or does it also get
stuck for that amount of time ?

When the QIO does complete, does the status in the IO status block indicate
success ? Is the data delivered properly ?

Even on a all mighty microvax II, mailbox IOs are very fast and certaintly
don't take minutes to complete.

 
 
 

SYS$QIOW - Performance Issue

Post by Vive » Tue, 27 May 2003 18:05:15


Hi Ron/Mezie,

As far as I know there is only one process reading the mailbox, I need to
check again.

If some process is writing to the mail box and other wants to read it, can I
see it in reference count?.

Most probably I will have to check if the block is written into the mailbox
or not as pointed by Ron.

You have been a great help.

Thanks
Vivek



> > SYS$QIOW reads 1024 bytes in one call.

> > Mail Box has max buffer of 2048 and message size as 1024.

> > The time taken by this call is 4 minutes to 10 minutes for eac call.

> During those minutes, is the process in LEF state ?

> If you do SHOW DEV MBAxxx:/full, what is the "Reference Count" ? That
shows
> how many channels are assigned to it. If you have 2 processes competing
for
> read operations, this may explain.

> With mailboxes and QIO, a message written to the mailbox gets delivered to
the
> channel who is first in the queue to read a message.

> So if you have 2 processes with READ pendings, and a appliaction that
expects
> one "command" message followed by one "data" message, then process 1 will
get
> the command message, and process 2 will get the "data message" (when it
would
> expect a command message), and process 1 then waits for a data message
that
> should have accompanied the command message.

> With QIOW, your process goes into LEF (waiting for event flag to be set)
until
> the IO completes.
> If your process goes into some other state, (especially one starting with
> RW___) it means that there is a serious problem.

> Does the process which writes to the maibox work normally, or does it also
get
> stuck for that amount of time ?

> When the QIO does complete, does the status in the IO status block
indicate
> success ? Is the data delivered properly ?

> Even on a all mighty microvax II, mailbox IOs are very fast and certaintly
> don't take minutes to complete.

 
 
 

SYS$QIOW - Performance Issue

Post by JF Meze » Tue, 27 May 2003 18:36:50



> If some process is writing to the mail box and other wants to read it, can I
> see it in reference count?.

Yes, you would see a reference count of 2.

But you could also have a single process generating a reference count of 2 if
it has 2 channels opened to that mailbox (for instance a lonely process
talking to itself with thr writes done on channel 1 and reads on channel 2.

Quote:> Most probably I will have to check if the block is written into the mailbox
> or not as pointed by Ron.

Another thing you can do, from a SPARE terminal:

$OPEN /READ/WRITE TEMP MBAnnn:
$WRITE TEMP "Deadly chocolate mousse"
$CLOSE TEMP

See if this triggers the READ in your process.

Note: if the maibox is full because the reads do not work, the above may get
stuck in the WRITE statement and you might need to kill the process. (or wait
for the reading process to read from mailbox). But if that happens, it gives
you an idea.

Are you sure that the reading process has actually issued the QIOW ? Is it
possible it is getting stuck waiting for something else before getting to the
QIOW ? (and when it does get to it, it comletes immetiatly because there is
already data in the mailbox).

Another thing you can do:

$OPEN/READ/WRITE TEMP MBAnnn:
$READ TEMP test
$SHOW SYMBOL TEST
$CLOSE TEMP

if the read completes right away, while your other main process is still
taking 10 minutes, it is an indication that the other process had not queued
the request to read before you queued yours, so you got the first packet in
the mailbox.

If the read gets stuck, you can either kill the process or get another process
to write to the mailbox (see the example above) and that will free it.

This can help you *MAYBE* understand what is going on.

Another thing to look at is the transaction count in the SHOW DEV/FULL to see
if it moves.

 
 
 

SYS$QIOW - Performance Issue

Post by Vive » Tue, 27 May 2003 19:05:00


Hi Mezei,

"Reference Count" is 2....

Thanks
Vivek



> > SYS$QIOW reads 1024 bytes in one call.

> > Mail Box has max buffer of 2048 and message size as 1024.

> > The time taken by this call is 4 minutes to 10 minutes for eac call.

> During those minutes, is the process in LEF state ?

> If you do SHOW DEV MBAxxx:/full, what is the "Reference Count" ? That
shows
> how many channels are assigned to it. If you have 2 processes competing
for
> read operations, this may explain.

> With mailboxes and QIO, a message written to the mailbox gets delivered to
the
> channel who is first in the queue to read a message.

> So if you have 2 processes with READ pendings, and a appliaction that
expects
> one "command" message followed by one "data" message, then process 1 will
get
> the command message, and process 2 will get the "data message" (when it
would
> expect a command message), and process 1 then waits for a data message
that
> should have accompanied the command message.

> With QIOW, your process goes into LEF (waiting for event flag to be set)
until
> the IO completes.
> If your process goes into some other state, (especially one starting with
> RW___) it means that there is a serious problem.

> Does the process which writes to the maibox work normally, or does it also
get
> stuck for that amount of time ?

> When the QIO does complete, does the status in the IO status block
indicate
> success ? Is the data delivered properly ?

> Even on a all mighty microvax II, mailbox IOs are very fast and certaintly
> don't take minutes to complete.

 
 
 

SYS$QIOW - Performance Issue

Post by Gary » Tue, 27 May 2003 19:08:02


Have you used the io$m_now fuction code modifier for asychronuous read/write
completion?


Quote:> Hi,

> I am reading data from the mailbox using the call SYS$QIOW( )

> SYS$QIOW reads 1024 bytes in one call.

> Mail Box has max buffer of 2048 and message size as 1024.

> I am encountering a problem of performance in reading from mail box on VAX
> machine, it is also happening on some ALPHA boxes and not on some.

> The time taken by this call is 4 minutes to 10 minutes for eac call.

> My Query is, if SYS$QIOW is the right call to read message from MAILBOX?

> Can I use alternative call to improve performance.

> Thanks
> Vivek

 
 
 

SYS$QIOW - Performance Issue

Post by Vive » Tue, 27 May 2003 19:16:10


This is what I did

$OPEN /READ/WRITE TEMP MBAnnn:
$WRITE TEMP "Deadly chocolate mousse"
$CLOSE TEMP

This is what it shows..
$OPEN /READ/WRITE TEMP MBA1

$READ TEMP test

$SHOW SYMBOL test

TEST = "Deadly chocolate mouse"

$ CLOSE TEMP



> > SYS$QIOW reads 1024 bytes in one call.

> > Mail Box has max buffer of 2048 and message size as 1024.

> > The time taken by this call is 4 minutes to 10 minutes for eac call.

> During those minutes, is the process in LEF state ?

> If you do SHOW DEV MBAxxx:/full, what is the "Reference Count" ? That
shows
> how many channels are assigned to it. If you have 2 processes competing
for
> read operations, this may explain.

> With mailboxes and QIO, a message written to the mailbox gets delivered to
the
> channel who is first in the queue to read a message.

> So if you have 2 processes with READ pendings, and a appliaction that
expects
> one "command" message followed by one "data" message, then process 1 will
get
> the command message, and process 2 will get the "data message" (when it
would
> expect a command message), and process 1 then waits for a data message
that
> should have accompanied the command message.

> With QIOW, your process goes into LEF (waiting for event flag to be set)
until
> the IO completes.
> If your process goes into some other state, (especially one starting with
> RW___) it means that there is a serious problem.

> Does the process which writes to the maibox work normally, or does it also
get
> stuck for that amount of time ?

> When the QIO does complete, does the status in the IO status block
indicate
> success ? Is the data delivered properly ?

> Even on a all mighty microvax II, mailbox IOs are very fast and certaintly
> don't take minutes to complete.

 
 
 

SYS$QIOW - Performance Issue

Post by Vive » Tue, 27 May 2003 23:55:03


Hi  Gary,

I hav now added the IO$M_NOW function code modifer.

Thanks
Vivek


> Have you used the io$m_now fuction code modifier for asychronuous
read/write
> completion?



> > Hi,

> > I am reading data from the mailbox using the call SYS$QIOW( )

> > SYS$QIOW reads 1024 bytes in one call.

> > Mail Box has max buffer of 2048 and message size as 1024.

> > I am encountering a problem of performance in reading from mail box on
VAX
> > machine, it is also happening on some ALPHA boxes and not on some.

> > The time taken by this call is 4 minutes to 10 minutes for eac call.

> > My Query is, if SYS$QIOW is the right call to read message from MAILBOX?

> > Can I use alternative call to improve performance.

> > Thanks
> > Vivek

 
 
 

SYS$QIOW - Performance Issue

Post by Vive » Wed, 28 May 2003 00:10:08


Hi  Gary,

All the SYS$QIOW calls only had the WRITEVBLK function code.

After adding the WRITEBVBLK function code the time take is reduced to 1
minutes from 4-5 minutes.

Seems there is and improvement.

Thanks
Vivek


> Have you used the io$m_now fuction code modifier for asychronuous
read/write
> completion?



> > Hi,

> > I am reading data from the mailbox using the call SYS$QIOW( )

> > SYS$QIOW reads 1024 bytes in one call.

> > Mail Box has max buffer of 2048 and message size as 1024.

> > I am encountering a problem of performance in reading from mail box on
VAX
> > machine, it is also happening on some ALPHA boxes and not on some.

> > The time taken by this call is 4 minutes to 10 minutes for eac call.

> > My Query is, if SYS$QIOW is the right call to read message from MAILBOX?

> > Can I use alternative call to improve performance.

> > Thanks
> > Vivek

 
 
 

SYS$QIOW - Performance Issue

Post by Howard S Shub » Wed, 28 May 2003 00:31:22




> Have you used the io$m_now fuction code modifier for asychronuous read/write
> completion?

Uh, w/o looking at the docs first, why would he do that instead of just
using SYS$QIO w/o the W?

--
Today, on Paper-view: The World Origami Championship

 
 
 

SYS$QIOW - Performance Issue

Post by JF Meze » Wed, 28 May 2003 02:47:20



> $WRITE TEMP "Deadly chocolate mousse"
> $READ TEMP test
> TEST = "Deadly chocolate mouse"

Something really fishy here... the MBA driver does not remove the second S
from Mousse :-)

What this means is that at the time you issued the WRITE statement, your
program had not queued an IO (eg: called QIOW) yet, and when you did the READ,
you were the first in line to get that packet.

Now, your program may have been busy processing the previous entry, or it
could have issued some wait statement BEFORE issueing the QIO.

It would seem to me that the next step would be to add some print statements
(in whatever language you are programming in, eg: printf for c) before and
after the QIOW statement which will give you a better idea of whether your
program is* inside the QIOW or outside of it.

 
 
 

SYS$QIOW - Performance Issue

Post by JF Meze » Wed, 28 May 2003 03:01:23



> Uh, w/o looking at the docs first, why would he do that instead of just
> using SYS$QIO w/o the W?

If the person wants his program to stop until it gets a transaction from the
mailbox, the easiest way is really to use QIOW without the "now" modifier.
the read should be IO$M_READVBLK  and the write should be IO$M_WRITEVBLK
without any other flags. You don't need much.

Mailboxes are fairly simple beasts.

 
 
 

SYS$QIOW - Performance Issue

Post by Gary » Wed, 28 May 2003 03:22:18


The qio call is asynchronous and the qiow is synchronous for all devices.
Mailboxes are virtual synchronous devices - so whether applying qio or qiow
the result is the same [in this case] a synchronous transaction is placed on
the device. The io$m_now modifier forces an asynchronous transaction on the
mailbox and this will complete immediately - even if there is a resource
wait on the device.

The main difference in respect to this case is that a qiow will wait until
the iosb [if specified] is filled with the device specific information
relevant to the IO function code.

 A qio will complete instantly returning to the caller the queued status of
the IO request, the iosb information may [in this case] be present too but
is not guaranteed unless the sys$synch  call is used in conjunction with the
qio.

 HTH,

Gary




> > Have you used the io$m_now fuction code modifier for asychronuous
read/write
> > completion?

> Uh, w/o looking at the docs first, why would he do that instead of just
> using SYS$QIO w/o the W?

> --
> Today, on Paper-view: The World Origami Championship

 
 
 

SYS$QIOW - Performance Issue

Post by Gary » Wed, 28 May 2003 03:47:06


This is still very suspicious.


> Hi  Gary,

> All the SYS$QIOW calls only had the WRITEVBLK function code.

> After adding the WRITEBVBLK function code the time take is reduced to 1
> minutes from 4-5 minutes.

> Seems there is and improvement.

> Thanks
> Vivek



> > Have you used the io$m_now fuction code modifier for asychronuous
> read/write
> > completion?



> > > Hi,

> > > I am reading data from the mailbox using the call SYS$QIOW( )

> > > SYS$QIOW reads 1024 bytes in one call.

> > > Mail Box has max buffer of 2048 and message size as 1024.

> > > I am encountering a problem of performance in reading from mail box on
> VAX
> > > machine, it is also happening on some ALPHA boxes and not on some.

> > > The time taken by this call is 4 minutes to 10 minutes for eac call.

> > > My Query is, if SYS$QIOW is the right call to read message from
MAILBOX?

> > > Can I use alternative call to improve performance.

> > > Thanks
> > > Vivek

 
 
 

1. SYS$QIOW - Wtih more Details - Final Try

I will try to be as explanatory as possible  in this mail.

Parent process creates mailbox both with read and write permissions.

And then it forks a child process throgh CREPRC

The child ASSIGNS to the parent mailbox with both read and write
permissions.

Through  the parents channel the parent writes to the mailbox with excellent
speed ( around a millisecond and less).
The data written through this is arounf 1024 bytes and less.

The Child reads from the mailbox from its channel but has problems.
There is fixed gap b/w each read request from the child process.

The times taken by the Read request spans from 2 minutes to 10+ minutes.
During this time the mailbox get more than 30 writes.
THe process is in LEF state during this time.

All the write and reads are using SYS$QIOW calls.

Will be more than happy to provide more details.

2. Alternate Reality Fans - Websites to check out!

3. Help using SYS$QIOW with DEC BASIC

4. How to find the current browser?

5. SYS$QIOW on mailboxes

6. Trap 000d problem

7. SUMMARY: SYS$QIOW and CTRLYAST

8. Rochester Admin job

9. needs help on SYS$QIOW system service

10. SYS$QIOW tape driver problems

11. Exit 412 Error On SYS$QIOW (MBX) After Y2K Patch

12. VMS Mailboxes: Why doesn't SYS$QIOW (IO$WRITEVBLK) return?

13. any help on sys$qiow(...)?