-2

I'm a bit unclear how the the RAM is used in this particular instance, so I'm wondering if when a user watches a video on my server, does it go from the filesystem, "out through the pipes" and onto my users screen, or does it go: filesystem>RAM>"pipes">User? If the video is loaded completely into RAM it will probably crash the server so knowing how this works is important to me.

I don't think it will go into the RAM though but I have to be absolutely sure because it's vital the videos can be watched by a number of people.

-- Forgot to detail what I'm using: my host is http://www.webfaction.com/ using nginx http server.

01AutoMonkey
  • 101
  • 2
  • I think we need more information here. What program are you using to share it with the internet at large? Apache? – trent Feb 08 '13 at 14:09
  • @trent ups, forgot, I've added the information to the post. – 01AutoMonkey Feb 08 '13 at 14:18
  • [SF] is for Professional System Administrator (et al) only. Your question reflects a substantial lack of knowledge regarding the workings of computers; you don't have the baseline knowledge to understand a reasonably complete answer. The short answer is: No – Chris S Feb 08 '13 at 14:19
  • @ChrisS are you referring to "what the RAM is used for"? I meant to say "I don't know how the RAM is used in this particular instance", and I suspect it's not used allot here but need to be absolutely sure, I do know that data is fed into the RAM so it can be accessed faster when needed since virtual memory is faster then reading from a hard drive for example. – 01AutoMonkey Feb 08 '13 at 14:26
  • Yeah, you're still getting it wrong. Virtual memory **is** read from the hard drive (not from RAM), to that point. – HopelessN00b Feb 08 '13 at 14:36
  • That's not what "virtual memory" is... And if it was *that* easy to crash a server, they'd be crashing all over the world all the time. Most server have uptimes measured in months, so it must be pretty hard to crash them. – Chris S Feb 08 '13 at 14:39
  • @HopelessN00b What do you mean "Virtual memory is read from the hard drive"? I know data isn't stored in virtual memory/RAM indefinitely and that it's fed from the hard drive to the virtual memory first and then used multiple times from virtual memory directly, or perhaps you're saying that every single time you read from RAM it goes from Hard Drive > RAM > .. > User , which I don't think is true, seems to me that if something needs to be used multiple times like certain data in a video game then it's loaded once into RAM and then used from there as long as the program hasn't cleaned it out. – 01AutoMonkey Feb 08 '13 at 14:52
  • @ChrisS when I say "crash the server" I mean the site will stop functioning, which I'm pretty sure happens, at least in some cases, when the RAM is completely full. – 01AutoMonkey Feb 08 '13 at 14:56
  • @GautamaDude Like Chris said, you lack the baseline knowledge to even understand a reasonably complete answer. In this instance, I assumed you were talking about the Windows definition of virtual memory (swapping), because the other definition of virtual memory is a memory management technique which just doesn't make any sense in the context you tried to use the term in. Refer to the one answer you got and/or do some testing to figure out what you need. Or hire a knowledgeable consultant (which is probably a good idea regardless). – HopelessN00b Feb 08 '13 at 15:01
  • @HopelessN00b I think it's not really my knowledge that's lacking but proper word usage and not being specific enough about what I'm asking for and why I don't know the answer, and based on that I'm assumed to not be capable of understanding the answer I'm looking for which is not correct at all, but I've pretty much got what I came for, the video will probably not be fed completely into RAM, and if I'm still not sure I could monitor the RAM while serving the video. – 01AutoMonkey Feb 08 '13 at 15:07
  • Most OSes do not crash when RAM is completely full. This is the baseline knowledge to which I refer. It's not just using the wrong word, it's a lack of understanding how RAM is managed, the various uses of RAM (cache, resource, paged, in-use, etc), what happens under certain conditions. nginx doesn't even load files into RAM, it uses mmap() or a similar function, then lets the OS provide file caching and access. – Chris S Feb 08 '13 at 15:43

1 Answers1

2

Most sane programs will read only parts of the file into the RAM and then stream it to users, discard it and read the next part.

There might programs which don't do and read the whole file that but I guess they aren't very popular...

Sven
  • 98,649
  • 14
  • 180
  • 226