Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

my ubuntu desktop seems to be running very slow, I wonder if the swap is mounted correctly?

root@xxxx:/home# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001b1be

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        4096   204802048   102398976+  83  Linux
/dev/sda2       204802049  1943279616   869238784   83  Linux
/dev/sda3      1943279617  1953517568     5118976   82  Linux swap / Solaris

Do I need to run any command to make sure the swap partition is Ok?

The top command shows:

top - 01:35:42 up  5:40,  1 user,  load average: 0.09, 0.17, 0.25
Tasks: 139 total,   1 running, 134 sleeping,   1 stopped,   3 zombie
Cpu(s):  4.3%us,  0.7%sy,  0.0%ni, 94.7%id,  0.2%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:   2035816k total,  1803908k used,   231908k free,   108984k buffers
Swap:  5118972k total,        0k used,  5118972k free,  1236104k cached

While free command shows:

/home# free
             total       used       free     shared    buffers     cached
Mem:       2035816    1820056     215760          0     109232    1248636
-/+ buffers/cache:     462188    1573628
Swap:      5118972          0    5118972

the swapon -s command gives:

Filename                                Type            Size    Used    Priority
/dev/sda3                               partition       5118972 0       -1

Thank you in advance!

share|improve this question

closed as too localized by Gilles, John S Gruber, Jorge Castro, con-f-use, hbdgaf Aug 23 '12 at 16:02

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
This doesn't say anything about whether the swap is mounted. Swap only has a minor impact on speed. (Not enough RAM can hurt, but swap won't help much.) The information you posted is completely irrelevant to the speed of the system. What makes you feel your system is running slow? Is it a particular application? Is it all the time, often, occasionally? Is the disk working hard when the system seems slow? Post the output of free and of top when the system is running slow. –  Gilles Jun 7 '12 at 23:56
    
Merci pour ta réponse @Gilles :-) System is running slow when the disk is working hard indeed. Here is a screenshot of the monitoring tool i.imgur.com/IjJkq.png. I can't see the swap usage near disk usage section. I'm only running owncloud and a VSFTP server. SSH connection is slow. –  Kiwifrog Jun 8 '12 at 0:23
    
@Kiwifrog If it's just the SSH connection that is slow, it could be the internet connection (on your side, or the server side, or somewhere in between) that is running slow. SSH involves encrypting your commands, sending them across the internet, decrypting them, executing them, encrypting the output/result/response, sending that back across the internet, and then finally decrypting it so you can see it. It's always going to be a bit slower than running things natively. –  adempewolff Jun 8 '12 at 2:06

2 Answers 2

up vote 2 down vote accepted

I don't believe the free command would list swap utilization if it weren't available to the operating system.

I think the free command output looks ok. It says you haven't needed to use the swap facility, a common occurance with systems with large amounts of memory like yours.

While it appears that you are using a large percentage of your memory that can be misleading. Linux will try to leave as many pages in memory as possible so that they can be reused should they be needed again without reloading them from disk.

If your CPU is idle like that during times of slow response CPU probably doesn't have anything to do with the slowdown.

If your system does a lot of I/O to disk to satisfy requests disk performance could be an issue in that way.

share|improve this answer
    
Ok. Looks like the disk has some performance issues indeed. I'll try to investigate in that direction. Thanks for helping eliminating other options. –  Kiwifrog Jun 8 '12 at 1:12

Use swapon -s to see which swap partitions are currently being used. You don't "mount" swap partitions, use the swapon command to turn them on or off.

share|improve this answer
    
Thanks for your answer @Angelo. I edited my question to show the result of the swapon -s command. –  Kiwifrog Jun 8 '12 at 0:48
    
Yeah, I guess I should have put 2 and 2 together since you had the swap available and unused. Probably not swap. –  Angelo Jun 8 '12 at 1:36
    
You can install the package sysstat and try running iostat to see if you have some io wait problems. –  Angelo Jun 8 '12 at 1:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.