# 99 idle and swapping?



## jamengual (Aug 10, 2012)

Hi.

I have a Supermicro server with FBSD 8.2 connected to a storagerack with 10 disk and a addonics card.

It has been stable for almost a year but now is not been a good boy.

I check traffic and process and I don't see anything weird, logs are normal except for some Ldap server not reachable( but it is ) and one zfs error :


```
WARNING pid 9480 (zfs): ioctl sign-extension ioctl ffffffffcc285a2f
```

I have 14 jails running different services like mysql , php-fpm, nginx, apache uwsgi, redis and others but there are behaving normal but for some reason I just have 500 M of ram free off 14GB and using 6M of swap in a server that doesn't have much traffic.

This is the top output :


```
last pid: 34608;  load averages:  0.00,  0.00,  0.00                                                                                                up 0+22:28:00  10:47:54
259 processes: 1 running, 258 sleeping
CPU:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
Mem: 800M Active, 1629M Inact, 10G Wired, 128M Cache, 1442M Buf, 585M Free
Swap: 17G Total, 5996K Used, 17G Free
```

vmstat -z looks fine too.

The main use of this server is basically as a backup using backuppc the rest of the jails are basically idle and some times depending on the backup process running at the moment I will see an increase on swap usage. 

I don't know how to find out how much memory zfs process are using and how to find out which services is swapping.

Does anyone can help me here ?

Thanks.


----------



## Crivens (Aug 10, 2012)

Please correct me if I am wrong, but it looks to me like there is about 6MB of swap space used with almost 600MB being free. That would not be a problem at all, I think.


----------



## jamengual (Aug 10, 2012)

Crivens said:
			
		

> Please correct me if I am wrong, but it looks to me like there is about 6MB of swap space used with almost 600MB being free. That would not be a problem at all, I think.



Yes it is right but this metric are from when the server has been ok normally I have 6GB of swap in use.

The thing is of all my other FBSD 8.2 servers ( with way more taffic that this one) I never get to have 600 mb free of 14 GBs that is why I'm kinda thinking that is not normal.

Thanks.


----------



## Martillo1 (Aug 10, 2012)

I do not see anything wrong. Maybe the swap was used by a process and another process freed RAM. Now I have a similar situation with 6420K Used swap and 2946M Free memory.


----------



## jamengual (Aug 10, 2012)

Maybe the problem that I do not understand how to represent correctly the top information.

If I see a system 99% idle with 14 GB of ram but 600M free I will think that is not really idle but I guess that the rest of the memory is wired "cached" so that is why the load average is 0 ?


----------



## Martillo1 (Aug 10, 2012)

Idle refers to CPU, the workhorse. Memory refers to RAM memory. Swap refers to disk where data from memory is put to free RAM.

Memory is capacity of data, where you put the data. CPU is work made with that data. 

You can have data in memory and not do any work on it.


----------



## jamengual (Aug 10, 2012)

I get that but where is should get worry about the performance ?

when I have no ram free and I'm swapping like crazy or when the wired memory is basically 0 and the active memory is = total memory of system ?

I remember that in Centos all the memory is cached and that is how appears in top, it is a similar case in FBSD ?


----------



## Martillo1 (Aug 11, 2012)

Install sysutils/gkrellm2 and enable the swap pages in/out chart to see if you are swapping a lot. You can also check it in top in the swap info line:



> Swap: 18G Total, 209M Used, 18G Free, 1% Inuse, 129M Out



That "129M Out" means that the system is taking 129 MByte out of memory to the swap in the update interval of top. Conversely there is a "nU In" when the process is the opposite (being n a number and U an unit). You can see swapping in an out at the same time as well. If there is not "In" nor "Out", then there is no swapping.


----------

