linux - Why when I run a program in a detached screen section it became very slow?

07
2014-07
  • AndreaNobili

    I am not so into Linux and I have the following situation related a strange behavior of the screen command.

    The situation is the following one: one a RaspBerry Pi I have installed Raspbian (that is a minimalistic version of Debian.

    I connect to the RaspBerry using SSH and I do the following operations:

    1) I create a new screen section to run a programm to keep it running when I off from ssh. The program is CPU miner, a program used to mine BitCoin\LiteCoin and it use a GridSeed that is an USB ASIC hardware that do the work (but I think that this is not so important)

    2) I type AD to exit the screen session so I log off from SSH.

    The problem is that when I detached the screeb section the performance decrease dramatically. It do exactly a sixth of the work that it do when the section is not detached.

    So I have no idea about this behavior and I can think only two thing:

    1) When a section is detached the priority of its process is decreased

    2) Maybe the RaspBerry hardware is not powerful enough and it can't appropriately handle the process in a detached screen section.

    What is the problem? what am I missing? what can I do to solve this issue?

    Tnx

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    linux - accidentally concatenate a large file on a remote system
  • Dan

    Every once in a while on a computer I'm ssh'd into, I will accidentally type "cat largefile.txt" and my screen will start rushing with text for the next 10 minutes. I'm always working in a screen session, so my current solution is to just log out and then log back in, and since it can go 100X faster when I'm logged out, it'll finish in the short time it takes me to type my password in again.

    Is there a better way? Either involving the fact I'm in a screen session? Or a way to do this within SSH?

    What doesn't work:

    • detaching from the screen session (doesn't respond until file is done outputting)
    • trying command to move to a different window in the screen session (also doesn't respond)
    • typing ctrl+C to kill cat command (also doesn't respond, probably because the command is done and the buffers just have to catch up)

  • Related Answers
  • Evan Carroll

    The obviously easy solution would be to not use cat. Your shell isn't a text viewer. Use less which is designed for this.

  • Dennis Williamson

    If you're using Bash, try Ctrl-z kill % Enter

    What shell are you using?

    (Ctrl-c works for me, by the way.)

  • intuited

    If you start a new screen window via ^A ^C, you will I think be able to "dodge" the oncoming buffer without having to logout & log back in again. It seems that the bottleneck is transmission of the buffer characters to your local terminal; switching to another window should alleviate the need for this effort. Not exactly a miracle cure, but it could save you some time.