vitorbaptista / shellshare

Live terminal broadcasts
https://shellshare.net
Apache License 2.0
223 stars 23 forks source link

fix "you've wrote too much too fast" error #58

Closed cjantonelli closed 5 years ago

cjantonelli commented 5 years ago

By assigning a buffer length to the f.read() op, you can read arbitrarily-long streams from the shellshare sender. There will be a 1-second delay between rendering each received buffer. Line 97 could be adjusted to delay less than a second, if desired.

vitorbaptista commented 5 years ago

Hey @cjantonelli, sorry for the delay in answering.

Nice catch! I couldn't reproduce the "you've wrote too much too fast" error, but I remember getting it a while ago.

I'll merge your PR, but I wonder: any specific reason you picked 4KB as the buffer? I'm thinking on increasing it to 32KB or 64KB to reduce the number of HTTP requests. What do you think?

cjantonelli commented 5 years ago

Hi Vitor, thanks for your note! We're basically trading buffer memory available on the server against the number of active shellshare connections and the amount of data each is sending, and since I have no idea how many simultaneous connections the server is expected to serve, but I'd expect each connection to be sending copious data, I picked 4 KB very conservatively to limit server load. (I started with 1KB!) I'm sure you know more about the server load than I do, so larger buffer sizes would probably work just fine.

Actually, I would think we could implement some sort of exponential backoff in the face of congestion, as long as a failed f.read() doesn't lose data. :-)

By the way, Vitor, your shellshare tool is great -- I use it in my training classes so my students don't have to strain to see the projection screen. Kudos!

Regards, Charles ,-- Dr Charles Antonelli IT Advocacy and Research Support | LSA Technology Services College of Literature, Science, and the Arts | University of Michigan cja@umich.edu

On Thu, Feb 21, 2019 at 2:06 PM Vitor Baptista notifications@github.com wrote:

Hey @cjantonelli https://github.com/cjantonelli, sorry for the delay in answering.

Nice catch! I couldn't reproduce the "you've wrote too much too fast" error, but I remember getting it a while ago.

I'll merge your PR, but I wonder: any specific reason you picked 4KB as the buffer? I'm thinking on increasing it to 32KB or 64KB to reduce the number of HTTP requests. What do you think?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitorbaptista/shellshare/pull/58#issuecomment-466125489, or mute the thread https://github.com/notifications/unsubscribe-auth/AHaONkjTkFeq0p9hnc6Ky96rhSUQVPwZks5vPu4fgaJpZM4aqMlW .

vitorbaptista commented 5 years ago

Thanks for the PR and explanation @cjantonelli. I merged with 4 KB and will be monitoring the server in case I need to increase (or reduce) it. There isn't much traffic, so I don't think we'll need an exponential backoff for now.

By the way, Vitor, your shellshare tool is great -- I use it in my training classes so my students don't have to strain to see the projection screen. Kudos!

I'm glad you found it useful! Your use-case is pretty much what I was thinking when building shellshare :+1: Out of curiosity, are you hosting shellshare yourself, or using shellshare.net? Did you have any issues with it, or any other feedback? Also, if you don't mind me asking, what are you teaching with shellshare?

Lastly, I saw that you forked shellshare and added Windows support. That's great! It's one of the main missing features of shellshare. Is your code working fine? I don't have a Windows machine, so can't test it, but would love to have it merged in.

cjantonelli commented 5 years ago

Hello Vitor,

Sorry for my egregious delay in responding!

I am using shellshare.net. I have had no issues with it, mostly. sometimes it seem to be slow, which I attribute to loading, which is why I chose such a small value for the read buffer size.

I teach some HPC courses at Michigan, which involve me logging in to our cluster login servers and demonstrating some things for the students. So we talk about scripting, HPC schedulers (PBS, SLURM), parallelization libraries (OpenMP, Open MPI), performance monitoring (Allinea MAP), some debugging (Allinea DDT). Our researchers mostly use R, Python, MATLAB, and Stata, and I go over parallelization techniques for each with demo scripts. A fun set of topics for me!

Finally, I forked that repo by accident! I am not making a Windows version, I'm a Unix guy from way back. I deleted it now.

Regards, Charles -- Dr Charles Antonelli IT Advocacy and Research Support | LSA Technology Services College of Literature, Science, and the Arts | University of Michigan cja@umich.edu

On Mon, Mar 4, 2019 at 11:42 AM Vitor Baptista notifications@github.com wrote:

Thanks for the PR and explanation @cjantonelli https://github.com/cjantonelli. I merged with 4 KB and will be monitoring the server in case I need to increase (or reduce) it. There isn't much traffic, so I don't think we'll need an exponential backoff for now.

By the way, Vitor, your shellshare tool is great -- I use it in my training classes so my students don't have to strain to see the projection screen. Kudos!

I'm glad you found it useful! Your use-case is pretty much what I was thinking when building shellshare 👍 Out of curiosity, are you hosting shellshare yourself, or using shellshare.net? Did you have any issues with it, or any other feedback? Also, if you don't mind me asking, what are you teaching with shellshare?

Lastly, I saw that you forked shellshare and added Windows support. That's great! It's one of the main missing features of shellshare. Is your code working fine? I don't have a Windows machine, so can't test it, but would love to have it merged in.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitorbaptista/shellshare/pull/58#issuecomment-469323168, or mute the thread https://github.com/notifications/unsubscribe-auth/AHaONp9frK8uza9czhWw8PSeNprSbxnrks5vTUzigaJpZM4aqMlW .

vitorbaptista commented 5 years ago

@cjantonelli Sounds super interesting, thanks for taking the time to answer me. I'm glad shellshare helped you a bit.

If you don't mind, would it be OK if I used your experience as a testimonial in the shellshare.net website? I don't plan to change the design now (I like it simple as is), but if I ever get into changing it, your example would be great in a "What people use shellshare for" section or similar. I'll let you know if/when I use it.

cjantonelli commented 5 years ago

Absolutely! I tell folks about it here all the time.

Regards, Charles -- Dr Charles Antonelli IT Advocacy and Research Support | LSA Technology Services College of Literature, Science, and the Arts | University of Michigan cja@umich.edu

On Wed, Apr 17, 2019 at 12:52 PM Vitor Baptista notifications@github.com wrote:

@cjantonelli https://github.com/cjantonelli Sounds super interesting, thanks for taking the time to answer me. I'm glad shellshare helped you a bit.

If you don't mind, would it be OK if I used your experience as a testimonial in the shellshare.net website? I don't plan to change the design now (I like it simple as is), but if I ever get into changing it, your example would be great in a "What people use shellshare for" section or similar. I'll let you know if/when I use it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitorbaptista/shellshare/pull/58#issuecomment-484172601, or mute the thread https://github.com/notifications/unsubscribe-auth/AHaONgHYpBqu2usafjFr239qwtXUoT2cks5vh1E7gaJpZM4aqMlW .

vitorbaptista commented 5 years ago

Thank you very much! Hope you had a great Easter break. Let me know if any other issues (or ideas) arise :)

cjantonelli commented 4 years ago

Hi Vitor,

I like shellshare so much that I'm going to have a poster on it at our IT Symposium here at the University of Michigan. We have these symposia once a year by IT folks for IT folks at Michigan. There's usually a room filled with posters on current work or interesting technologies for the purpose of sharing and awareness, and this year shellshare will be one of them!

I've attached a PDF so you can see what I'm going to show there. If you have any recommendations I'd be happy to take them. I'm assuming you'd like the publicity, but I thought it best to check with you.

If you have suggestions, I'd need them by Monday October 21 mid-day, so I can meet the poster submission deadline.

I'm also using this to propose that we bring up our own shellshare server here, and maybe offload some of our traffic from your server :-).

Regards, Charles -- Dr Charles Antonelli Research Computing Support | LSA Technology Services College of Literature, Science, and the Arts | University of Michigan cja@umich.edu

On Wed, Apr 24, 2019 at 10:30 AM Vitor Baptista notifications@github.com wrote:

Thank you very much! Hope you had a great Easter break. Let me know if any other issues (or ideas) arise :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitorbaptista/shellshare/pull/58#issuecomment-486266745, or mute the thread https://github.com/notifications/unsubscribe-auth/AB3I4NW54RXOQF6LLTSADOTPSBVJLANCNFSM4GVIZFLA .

vitorbaptista commented 4 years ago

@cjantonelli That's amazing! I think there was a problem with your PDF upload. Any chance you could send it to me? If it doesn't work on GitHub, you can reach me on vitor at vitorbaptista dot com (sorry for the late reply)