-7

A moderator closed a question of mine as a duplicate despite it not being a duplicate (the circumstances and the question are different, he claimed it was a duplicate of a general FAQ-style question). He also implied twice in comments that I was somehow withholding information, and generally just didn't seem to grasp the question I was asking.

I then posted another question (written better than the original, which admittedly was worded a bit vaguely) asking the question more clearly and explaining why it is not a duplicate of the existing answer. A few minutes later, the same moderator deleted it without explanation.

To repeat important details: I am asking about why a clean install being used only for an incoming SSH tunnel would be showing such high memory usage coupled with a regular failure of the tunnel. The VPS provider appears to be counting cache memory in their totals, adding up to 2GB in the VPS control panel while top and ps show nothing out of line. This would imply caching, but I can't figure out what's actually being cached as there's nothing else running and the OS doesn't even take up that much on disk. The high memory usage started at the same time the ssh tunnel started failing, both without any configuration changes, so they may be related; they are also not normal behavior, as the machine ran without either issue for several months.

The moderator who targeted these questions doesn't seem to understand this, as he appears to think that this is normal behavior by simply referring to a general FAQ about memory.

Thoughts?

  • 1
    That your system appears different from how you remember it is of no consequence. From a sysadmin point of view it looks entirely normal. Without evidence to the contrary that's the long and the short of it. – user9517 Jan 18 '14 at 20:20
  • In that case, why would the SSH tunnel be repeatedly failing with no log messages, with that behavior appearing at the same time as the high cache usage? That's not normal, and that's what I'm trying to debug. If the high cache usage isn't related, then it's an incredibly strange coincidence. Given a lack of any information about the SSH failure, I'm hoping finding the source of the cache usage might give me a clue as to the source of the SSH errors. That's why I asked the question. – Justin Mrkva Jan 18 '14 at 20:56
  • 2
    Stop arguing, gather evidence and present it. Up the log verbosity; install and configure monitoring. Without evidence there is nothing we can do except guess. My guess is sunspots. – user9517 Jan 18 '14 at 21:01
  • Good advice to increase log verbosity, I just did that for sshd and I'll see what happens next time the tunnel fails. Is there a way to do the same thing and somehow log messages related to memory/cache errors? – Justin Mrkva Jan 18 '14 at 21:23
  • 1
    You have a note in that question: "This is NOT a duplicate as it was marked. The circumstances are substantially different." Why don't you substantiate that note. Edit your question to explain how and why your question is different. Do not add this as "Edit" or "Update", rather, rewrite your question to include the additional information organically, not in forum-style. (This is a general guideline. I don't know enough to say whether your question is salvageable. In fact, I barely read it. It's not a subject on which I am well informed.) – TRiG Jan 23 '14 at 11:51
  • 1
    @TRiG I appreciate the advice; I can see how editing the question instead of appending info is a better approach. The information is scattered through the comments and it's a bit difficult to keep track of. Right now I can't edit it, though, and besides, I moved to a new VPS provider which fixed the problem (confirming it was in fact the provider) so the question is moot now. – Justin Mrkva Jan 23 '14 at 19:56
9

There are two issues here.

  • The problem is highly unlikely to be linked to your hypothesized problem.
  • You're failing to connect the dots between what we've been telling you and the probabilities surrounding your potential faults.

Yes, it is odd that the VPS provider is reporting "used" RAM that isn't 'used' according to the OS. The VPS provider has a different definition of 'used' than the OS does.

VPS Provider: Has a RAM block been allocated for any reason at all? (y/n)
OS Metrics: Is a RAM block not allocated or allocated in either the cache or buffer pools? (y/n)

There are a few kinds of caches in the Linux kernel. Just by starting a server up and launching the normal Linux services like SSH it will access a large number of library files, a fact that was mentioned in the linked duplicate question.

-- for example the C library (needed by pretty much every program you run) is almost always held in cache memory, so the system doesn't have to go to the disk to find the instructions it needs to print "Hello World" on the screen.

Which is a large part of why we keep saying you haven't actually read the question. Just turning a server on will load up Cache with a wide range of library files in the file-cache. Additionally, it will also keep a block cache of accessed disk-blocks in read-ahead buffers and other such.

As a side note, some hypervisor platforms can actually deduplicate RAM pages. So if you've got 18 Ubuntu 12.04 instances running about the same patch-level, all those libc loads will actually deduplicate in RAM on the host and not be charged against the VM itself. I can't remember if OpenVZ is one of those or not.

Because of how cache/buffer works, the kernel will flush a cache or buffer block if it needs RAM for a process. Once there are no cache, buffer, or free RAM blocks available and it still needs RAM, it will turn on the Out Of Memory process. I believe you've determined that you don't have those log-entries.

This tells us, rather strongly in fact, that it isn't a memory problem. However, it seems you haven't connected the dots. I hope they're connected now.

And that leaves, "Get more data, and refine your hypothesis". Iain's suggestion of turning up log-verbosity is the step you should have taken after reading the 'duplicate' question and the 40-upvoted answer below it. Since SSH is the process experiencing the fault, that should be your first spot to turn up logging. The Kernel doesn't have a way to tune cache logging since it's part of the memory allocator, the only logs it produces are Out of Memory messages so continue to look for those.

  • Thanks for the explanation. I'm assuming at this point that it has to do with OpenVZ since as I've said, I've run a lot of Linux machines before without this problem. (I actually created a CentOS VM instance with 2GB of RAM and configured it with the same configuration script, then ran the tunnels against that VM instead of the VPS... the free output showed that it behaved VERY differently than the VPS I'm asking about in the question, and instead behaved like the VPS has done for the months before I noticed the change). I'll just continue to monitor the logs and see what happens... – Justin Mrkva Jan 19 '14 at 3:30
  • I switched VPS providers. The free command now shows what I expect it to, and the tunnel does not fail. I used the exact same configuration script and nothing changed on the tunneling machine. So there was DEFINITELY something wrong. Whether the weird memory usage was directly related or a symptom of a larger problem with the host, I guess we'll never know. The only major differences are the virtualization software and the kernel version used by each. – Justin Mrkva Jan 19 '14 at 16:14
6

"Cache" isn't taken up by programs. It's taken up by the OS itself. It will hold anything it reads from disk in the cache until someone else needs that memory, literally anything else, so it's just like "free" except it has information that might be valuable. You do not have high memory usage per your own data.

Also, there are TWO moderators telling you the same thing.

I still don't think you've read that linked question. Please stop posting about this issue until you have.

  • But 2GB of cache is used less than 30 seconds after a reboot, where there is far less than 2GB on disk and nothing being sent through the tunnel. The VPS control panel reports cache as part of its memory usage, and prior to a couple weeks ago always reported low usage. That's my question - why would it suddenly begin using large amounts of cache where it didn't before, and where there simply isn't enough data to fill the cache anyway? – Justin Mrkva Jan 18 '14 at 19:49
  • The critical thing to remember is that it never filled the cache like this before a couple weeks ago, and nothing has changed in the meantime. It's not about the cache being filled - it's about why it's suddenly doing it now and not before, and why at the same time the SSH tunnel is repeatedly failing with no messages or warnings (I've checked /var/log/secure and there's nothing that indicates a failure - it's a silent failure that requires a reboot before any more SSH tunnels can be created). – Justin Mrkva Jan 18 '14 at 19:54
  • 3
    I don't doubt that your server has an issue, but this is not it. At best the cache thing is a symptom of some completely separate problem, more likely it's a red herring. If I had to randomly guess this sounds like a corruption or hardware failure, possibly the former caused by the latter or a specific event. – Chris S Jan 20 '14 at 0:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .