*Synopsis*: ksh93 tail -f, with unconditional .25s sleep and line parsing, 
about 37x slower than cat

CR 6920072 changed on Jan 26 2010 by <User 1-5Q-1267>

=== Field ============ === New Value ============= === Old Value =============

See Also               6790507                                                
====================== =========================== ===========================

     
*Change Request ID*: 6920072

*Synopsis*: ksh93 tail -f, with unconditional .25s sleep and line parsing, 
about 37x slower than cat

  Product: solaris
  Category: utility
  Subcategory: text
  Type: Defect
  Subtype: 
  Status: 1-Dispatched
  Substatus: 
  Priority: 3-Medium
  Introduced In Release: 
  Introduced In Build: 
  Responsible Engineer: 
  Keywords: 

=== *Description* ============================================================
Running tail -f on a nightly.log during a build on an Opensolaris snv_126 
machine,
I noticed that the tail was running long after the build had completed.  The 
first
time I killed it; the second time I decided to let it run.  *26 minutes* after 
the
build completed, it finally completed (the entire build had only taken 28 
minutes).

Now, this was across an ssh connection from EGO02 to MPK17, but I took the same
log file and did several tests:

tail -f: 26:XX
nfs cp:  00:29
scp:     00:29
scp -C:  00:36
cat:     00:42

That's quite a difference.

Trussing the command, I see that it's ksh93, and that ksh is apparently reading
line-chunked things of approximately 8K, and writing line-chunked blocks to the
output, and unconditionally delaying .25s between each stat/read/write call.
That latter, in particular, seems to be the biggest problem, and seems 
ill-advised;
if there's to be a delay, it seems like "stat, and if no change sleep and then
stat again" would be a lot more efficient.

Also, for -f, I don't see why there's any point in doing the line-oriented 
calls;
original tail didn't, and I can't imagine it's a win.

*** (#1 of 1): 2010-01-26 04:51:29 GMT+00:00 <User 1-5Q-12546>


=== *Public Comments* ========================================================

=== *Workaround* =============================================================

=== *Additional Details* =====================================================
        Targeted Release: 
        Commit To Fix In Build: 
        Fixed In Build: 
        Integrated In Build: 
        Verified In Build: 
  See Also: 6790507
  Duplicate of: 
  Hooks:
        Hook1: 
        Hook2: 
        Hook3: 
        Hook4: 
        Hook5: 
        Hook6: 
  Program Management: 
  Root Cause: 
  Fix Affects Documentation: No
  Fix Affects Localization: No

=== *History* ================================================================
        Date Submitted: 2010-01-26 04:51:29 GMT+00:00
        Submitted By: <User 1-5Q-12546>

        Status Changed    Date Updated                  Updated By


=== *Service Request* ========================================================
        Impact: Significant
        Functionality: Secondary
        Severity: 3
        Product Name: solaris
        Product Release: solaris_nevada
        Product Build: 
        Operating System: snv_126
        Hardware: generic
        Submitted Date: 2010-01-26 04:51:30 GMT+00:00


=== *Multiple Release (MR) Cluster* - 0 ======================================

Reply via email to