Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am having a system with 8GB of RAM and running mysql on it ,top command shows

Mem: 8124416k total, 8110004k used, 14412k free, 21292k buffers Swap: 8388600k total, 1712132k used, 6676468k free, 2058600k cached

vmstat 1 gives this output

 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 3  0 1712132  38596  21628 2033920    0    0   451    77    0    1 14  1 81  5  0
 1  0 1712132  38412  21628 2033928    0    0    32     0  695  534  9  1 90  1  0
 0  0 1712132  37992  21656 2034412    0    0   476   136  630  474  8  0 84  8  0
 0  0 1712132  37992  21656 2034424    0    0     0     0  232  138  4  0 96  0  0
 2  0 1712132  37540  21656 2034424    0    0     0     0  463  228 41  1 58  0  0
 1  0 1712132  37480  21656 2034440    0    0    16     0  393  208 26  0 74  0  0
 2  0 1712132  37932  21664 2034432    0    0     0   244  655  454 38  1 59  2  0
 1  0 1712132  38056  21664 2034440    0    0     0     0  403  193 36  0 63  0  0
 0  0 1712132  38056  21664 2034440    0    0    16    16  498  362 13  0 87  0  0
 3  0 1712132  37872  21664 2034488    0    0    48     0  463  350  9  1 89  1  0
 1  0 1712132  37996  21664 2034488    0    0    16     0  765  536 29  0 70  0  0
 3  0 1712132  37996  21672 2034512    0    0    16    92  855  539 46  1 53  0  0
 2  0 1712132  38432  21676 2034508    0    0    20     0 1015  545 63  1 36  0  0
 0  0 1712132  38680  21684 2034544    0    0     0    72  540  307 34  0 66  0  0
 6  0 1712132  38556  21684 2034544    0    0     0     0  926  518 80  1 20  0

0

free -m gives

             total       used       free     shared    buffers     cached
Mem:          7934       7910         23          0         21       1999
-/+ buffers/cache:       5889       2044
Swap:         8191       1672       6519

is the use of swap space a concern or is it normal and ok.

Thanks IN advance Pankaj

share|improve this question
    
Could you please paste vmstat output in "Code sample" format, please? It will be easier to read. –  Francisco Aug 10 '09 at 16:46

5 Answers 5

up vote 3 down vote accepted

The important column in your case isn't swpd but si and so. It's normal and healthy for Linux to swap unused stuff out. If, however, si and so showed constant activity, that would imply that you did not have adequate resources for your usage pattern. As others have pointed out, that would mean you had either a leaky app or just not enough RAM.

Frankly, I don't see anything disconcerting about the vmstat info you've posted.

share|improve this answer

If I'm reading the numbers correctly (difficult w/o proper formatting), I'd say your system isn't running as well as it could. Could be a memory leak for an application or just having application requirements that are too heavy for your system's hardware.

Run a top and sort by memory usage to see what's taking up so much RAM. If it's possible, I'd restart the service that's taking up all the memory and watch it closely over time to see how quickly it reverts to chewing up so much memory.

Using a lot of swap isn't always a problem, so long as is doesn't thrash the disks. Use of swap can be a healthy use of resources or detrimental, depending on how the machine is performing.

What's the load on the machine?

share|improve this answer

Is this how the system operates in a normal state? I don't think it's a huge concern, but it appears this system would benefit from an increase in RAM. Where is the load?

share|improve this answer
    
mysql is taking the load 69.5 % memory !! –  Pankaj Joshi Aug 10 '09 at 17:14
    
On a mysql server you want the majority of memory to go to mysql for buffer and cache, I don't think there's anything wrong with that. But as mentioned by someone else you want to minimize the swap for mysql so it can focus on going to disk only for table data –  Swish Aug 10 '09 at 17:40

Being a database server, I would tell you that continuous swapping (si and so columns) is not a good signal.

Which is the size of MySQL's innodb__buffer___pool__size parameter?

share|improve this answer
    
innodb__buffer___pool__size is 4915 MB , I am not getting any value on the si and so coulmns. –  Pankaj Joshi Aug 10 '09 at 17:14
    
That's about 65% of your memory allocated to MySQL buffer. Seems reasonable (without knowing your workload, though) but would be great to know if the system has always swapped or it just begun recently. Maybe a recent SQL or application change is causing the problems. –  Francisco Aug 10 '09 at 17:58

Linux systems tend to swap out unused data, though I'm not sure why you have 1GB of hardly used information in RAM. I would be far more concerned if your si/so values were non-zero.

I assume you're using InnoDB for storage for all tables? Have you done any custom tuning for performance? Are you actually seeing an issue, or just concerned by the numbers?

share|improve this answer
    
Yes thats what concerns me also why 1 GB of hardly used memory is in RAM , Yeah the box is configured for innodb 65% memeory I have allocated to innodb_buffer_pool_size. I am concerned with the numbers whereas the performance is ok. –  Pankaj Joshi Aug 12 '09 at 10:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.