New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Why do my two identical VM's have such diff RAM usage?
Why is my RAM usage so different between the MASTER (NS1) and SLAVE (NS2).
Is this normal? Both exist on two different VPS nodes and both are in separate cities. Same hosting provider.
Both running Ubuntu 12.04 LTS + MySQL server + PDNS (authoritive)
NS2 = SLAVE
NS1 = MASTER
root@ns1:~# free -m total used free shared buffers cached Mem: 768 364 403 0 0 28 -/+ buffers/cache: 336 431 Swap: 0 0 0 root@ns2:~# free -m total used free shared buffers cached Mem: 768 39 728 0 0 12 -/+ buffers/cache: 26 741 Swap: 0 0 0
Comments
Post your TOP
root@ns1:~# top
Installed services/programs.
@Maximum_VPS - they are IDENTICAL. Spawned at the same time, installed with the same programs. The only difference is one is the master and the other the slave in MySQL.
@Noerman
NS1
NS2
I think you have answered for yourself "The only difference is one is the master and the other the slave in MySQL."
What is “cached” in the top command?
http://askubuntu.com/questions/198549/what-is-cached-in-the-top-command
@xDragonZ is correct.
@xDragonZ - does that really result in a 300 odd MB increase in RAM? If so i'm happy to have solved it - I just can't fathom why it would need so much more, considering the slave holds the same data?
My first time running a MySQL replicated DNS server - so i'm merely curious as to the difference in resources required.
Thanks,
Is this on OpenVZ?
@NickM - Yes both OpenVZ
Is there anything missing from your top output? I don't even see pdns on NS1.
@NickM - Hmmm somehow it PDNS stopped itself on NS1 - started it again. Still usage on NS2 is far less - must be MySQL then as, as soon as I stop it usage falls dramatically.
So it seems master VPS needs way more specs than the slave.
Would one be able to run master on say 512MB and Slave on 128MB or would that only work until the master falls over and the slave needs to pickup the slack?
OR
Would it be fine as the slave doesn't replicate back to master?
I can't really think of a reason that your master would be using that much more memory than your slave. I suppose if your ns2 isn't getting any traffic at all, your ns1 would be using a bit more memory.
I really wouldn't recommend anything less than 512MB for a MySQL server, regardless of whether it's a slave or a master. Sure, you can tweak mysql to the point where it's using very little memory, but at that point, you're just going to be hitting the disk more as tables no longer fit into memory, etc.
Actually... I just thought of something... Is it possible that one node is using 2.6.18 kernel and the other is using 2.6.32? OpenVZ counts memory differently depending on which kernel is being used, so you might want to check with your provider (uname -a will NOT tell you the actual kernel version being used on the node).
Aside: Is anyone even using .18 anymore?
Slightly off-topic: I know this is LowEndTalk, but I've never been one to worry about memory usage too much. And nowadays, considering that you can get 1GB for $5 a month from reliable providers, I care even less.
Linux memory is basically
used = used
free = free + buffers + cache
Think of it this way.
Ideally, you get NOTHING from ram being free (if anything your host if OpenVZ gets to oversell from you not using your ram). So its best it is put to use. Linux puts it to use caching the file system (disk = slow, ram = fast).
BTW if you hit the ">" key in top it will change the sort by column alowing you to see what is using the memory.
Master has table and query caches, slave does not - at least not with row repl.
Try
mysqlreport
to get more details on how MySQL is using RAM.Maybe your queries runs on the master and consuming bufferbspace.
Linux also uses memory for inode caching, which is not accounted for in your "cached" memory usage.
You need to do a sync && drop caches to see actual, real memory usage.