[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Two questions about kfreebsd

On 22/02/13 05:49, Bret Busby wrote:
> On Thu, 21 Feb 2013, Steven Chamberlain wrote:
>> [...]
>> vm.swappiness controls the balance of RAM/swap used, on some 0 to 100
>> scale.
> I am not sure how or where I set it, but, from memory, I had set it to 80.

It's a sysctl, so you adjust it like this (as root user) :

# sysctl -w vm.swappiness=60

And you could put "vm.swappiness=60" (without quotes) in your
/etc/sysctl.conf to have it always set to this on boot.

> "
>  free
>              total       used       free     shared    buffers cached
> Mem:       8059964    7987392      72572          0      90776 2146164
> -/+ buffers/cache:    5750452    2309512
> Swap:     42860340     821564   42038776
> "
> And, this tying up of memory, by caching of memory, appears to be a
> nuisance that I can not eliminate.

The cache isn't tying up memory;  cache data is purged as soon as your
system has a demand to use it for something else.  Since free memory
would be doing nothing, it might as well be caching data from your disks.

Based on the "- buffers" figure I'd describe this as ~70% RAM used.
Using more than 5 GiB of RAM on a desktop PC seems quite a lot to me,
unless you're currently doing something intensive like editing high-res
photos in GIMP, running a big Java application, or in the middle of
compiling a big piece of software.

> Whilst the above, shows some swapping to be occurring, the swapping is
> not enough to be worthwhile.

Usually swapping is seen as a bad thing - disk I/O is always going to be
slower than RAM, quite possibly by some factor of 10x to 1000x.  The
defaults on Linux are tuned to try to avoid swapping.

Maybe you should not be trying to encourage swapping after all.
Whatever issue you had, maybe this is the wrong approach?

(btw. on my own desktop I have 8GiB RAM, and just 256MiB swap - in my
situation this keeps lag/latency of the computer to a minimum - for a
few months I didn't enable any swap at all)

> The data transmission rate seems to slow when the memory usage
> increases; "inverse proportionality ratio"?
> As a simple example, (apart from all of the rubbish that gmail involves,
> with its access obtsructions) it is taking about 20-25 minutes to log in
> to gmail, and it mostly times out, when I have memory usage >50%.

This seems very wrong.  I advise some further investigation before
making a more drastic change like to kFreeBSD or another operating system.

I would check reasons for such high RAM usage, use of the network
connection by other running programs, performance of the network
connection when nothing is running (e.g. single user mode), and if the
browser is working correctly.

Tools like top, iftop, dstat, tcpdump/wireshark should be most useful
for this.

Steven Chamberlain

Reply to: