Python Forum
i want to make a cli command that ...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i want to make a cli command that ...
#10
(Sep-29-2017, 08:34 PM)nilamo Wrote: Quick, how does the real tail handle an input stream larger than system memory?  yes | tail

I don't know what it would do, but reading all of stdin seems like a bad idea.
just to be safe, instead of running this on my laptop (not even in a VM on it) i fired up an AWS cloud instance (15GB) and ran i there.  it is still running but i am not sure what it is doing.  both yes and tail have used up about 4GB each (seems a lot for yes) but are not growing  it's not using any swap space, either.  my guess is that the real tail is counting duplicate lines. if yes needs that much space, it must be taken up virtually by the library ... in both processes.  there seems to be no slowdown.

Output:
lt1/forums /home/forums 2> ssh ec2-user@2600:1f18:6291:9700:19e2:fac9:a9fb:19d4 Warning: Permanently added '2600:1f18:6291:9700:19e2:fac9:a9fb:19d4' (ECDSA) to the list of known hosts.        __|  __|_  )        _|  (     /   Amazon Linux AMI       ___|\___|___| https://aws.amazon.com/amazon-linux-ami/2017.03-release-notes/ [ec2-user@ip-172-31-0-76 ~]$ yes | tail
and in another window and ssh session (not running slow), two commands separated by some time:
Output:
lt1/forums /home/forums 1> ssh ec2-user@2600:1f18:6291:9700:19e2:fac9:a9fb:19d4 Warning: Permanently added '2600:1f18:6291:9700:19e2:fac9:a9fb:19d4' (ECDSA) to the list of known hosts. Last login: Sun Oct  1 05:43:55 2017 from 2a02:348:61:5d75::f        __|  __|_  )        _|  (     /   Amazon Linux AMI       ___|\___|___| https://aws.amazon.com/amazon-linux-ami/2017.03-release-notes/ [ec2-user@ip-172-31-0-76 ~]$ ps awux|egrep 'yes|tail'|fgrep -v 'grep' ec2-user  3171 99.9  0.0   4316   708 pts/0    S+   05:21  24:48 yes ec2-user  3172 51.2  0.0   4344   732 pts/0    R+   05:21  12:42 tail [ec2-user@ip-172-31-0-76 ~]$ ps awux|egrep 'yes|tail'|fgrep -v 'grep' ec2-user  3171 99.9  0.0   4316   708 pts/0    R+   05:21  35:21 yes ec2-user  3172 51.1  0.0   4344   732 pts/0    S+   05:21  18:06 tail [ec2-user@ip-172-31-0-76 ~]$

i killed yes and tail output 10 lines of "y" (as expected).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
i want to make a cli command that ... - by Skaperen - Sep-28-2017, 03:44 AM
RE: i want to make a cli command that ... - by Skaperen - Oct-01-2017, 06:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  i need to make a command that ... Skaperen 5 2,851 Nov-30-2019, 09:20 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020