Questions tagged [swap]

Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory(RAM) and the swap space is the amount of virtual memory available. Linux has two forms of swap space: the swap partition and the swap file.

Filter by
Sorted by
Tagged with
0 votes
1 answer
219 views

Centos 6.10 Swap File Issue Wrong size

I have Centos 6.10 Server with initial swap of 3.81 GB working ok no issue. I noticed wrong swap today amount of 4kb. I tried removing the partition and recreate entry on fstab and remount but no ...
2 votes
1 answer
4k views

Make Ubuntu Server use less swap and more actual RAM

I have a server with 128 GB of RAM and a 100 GB hard drive in it. It seems to use pretty much swap instead of using actual RAM when rsyncing disks. I found other questions on Stack Overflow with ...
7 votes
3 answers
28k views

What is the danger in having a fully used SWAP in an Ubuntu server?

One of my Ubuntu servers' swap partition is full. What are the dangers and/or performance ramifications of this situation?
3 votes
4 answers
4k views

Running swap on RAID10 or RAID5?

In follow-up to this previous question (and it's excellent answer), I am curious to know if running swap on a RAID5 might not be better than on a RAID10. My thinking is that you might lose a bit on ...
1 vote
0 answers
190 views

Why is my kernel choosing disk swap over 24G of inactive RAM?

Output below is meminfo from a Proxmox hypervisor. I noticed today that swap usage was 90%. I logged into the box and checked and and it seems there is actually 24G of inactive RAM. A couple minutes ...
3 votes
4 answers
2k views

Creating swap files faster

I'm using Amazon EC2 and wish to be able to quickly generate large swapfiles (~10+GB) on instance startup. Unfortunately, I/O speed on my instances (c1.xlarge) is slow enough (20 MB/s) that this ...
1 vote
3 answers
2k views

Missing mdam RAID1 array during scan

I have built a new server (Ubuntu 18.04.1) with 4 HDD. My plan is to use RAID1 overall and came up with this layout after investigation: sda, sdb four primary partitions (all as fd) with sda1/sdb1 ...
15 votes
2 answers
15k views

Avoiding swap on ElastiCache Redis

We have been having ongoing trouble with our ElastiCache Redis instance swapping. Amazon seems to have some crude internal monitoring in place which notices swap usage spikes and simply restarts the ...
1 vote
1 answer
4k views

Proxmox doesn't recongnize increased swap space

So I tried to increase the swap LV from 8GB to 16GB, but Proxmox web panel doesn't seem to see the change. The LVM increased the space, but Proxmox haven't changed it's panel. Originally lvdisplay ...
2 votes
2 answers
1k views

Could swap use many inodes?

I have got a graph about high inode use of our server's disk but I haven't got any detailed information (like df -i) so I'd like to guess the reason. Operating System: Red Hat Linux Process: PDF ...
0 votes
1 answer
396 views

Machine swapping despite there being enough memory

One of our Docker hosts is swapping like hell for no reason - at least, no apparent one (it's a Ubuntu 16.04LTS VM). All Docker containers in summary only use ~4 GB of the 12GB RAM total, but the ...
5 votes
1 answer
17k views

why is kswapd using high CPU on an idle system?

I have an idle Linux centOS system and yet kswapd is using 100% cpu. All I have running is a single bash session with top running.... I have 32G RAM and yet kswapd is constantly using 100% cpu for ...
1 vote
1 answer
911 views

mysql swap file crash on freebsd

I have a low memory VPS that mysql and the swap file crash out every morning at exactly 0300. There are no cronjobs on the system that have been configured. The server is a basic LAMP development ...
0 votes
0 answers
546 views

Swap unused, high memory usage and swappiness at 100

I'm running a server with a number of game servers on it. My memory usage is very high, however there is almost no swap usage in comparison. My swappiness is set to 100 total ...
71 votes
10 answers
33k views

Linux: how to explicitly unswap everything possible?

I've launched something that took lots of memory and now everything lags a lot. I guess all applications' memory has gone to swap in order to free some space for the memory-intensive process, and now ...
0 votes
1 answer
2k views

JVM heap is being swapped causing GC go haywire - Tomcat

Info: # of VMs= 4, each with an instance of Tomcat 8.5.* in cluster Apps = 5 war applications- 2 UI applications and 3 Webservices. Java Version = java 1.8.* Configuratin = 2 LTMS and 2 Apache ...
0 votes
0 answers
365 views

Cannot mount swap partition at boot on Amazon Linux 2

I am trying to mount swap partition in etc/fstab on Amazon Linux 2, but it doesn't work on the boot-up process. here the steps I have followed: create swap file: dd if=/dev/zero of=/swapfile bs=1024 ...
2 votes
0 answers
4k views

Linux swap partition not mounted by systemd on boot after dist-upgrade

Recently, I performed a dist-upgrade from Debian Wheezy to Jessie. The upgrade was performed without any error but after the upgrade the swap partition was no longer mounted/activated. The mentioned ...
1 vote
2 answers
3k views

High swap usage on CentOS server with plenty of spare RAM

We have a fleet of web hosting servers all running the exact same software & hardware with similar load. One of our server gets very high load that leads to it locking up for brief periods of ...
5 votes
2 answers
4k views

Swap with a huge amount of ram available

I have an old, legacy server with an odd problem with swap. Linux version: Red Hat Enterprise Linux Server release 5.6 (Tikanga) Kernel version: 2.6.18-238.el5 Server is virtual. Server has 2 virtual ...
1 vote
0 answers
772 views

OOM killer kills process though page cache is never evicted

Our servers in production sometimes under load runs into the following issue (Linux 4.10): Application handling the load (webserver) is running at high load. A new job starts (e.g. cron). This ...
2 votes
1 answer
2k views

How to prevent kernel I/O thrashing in absence of swap memory on Linux?

I had problem with a process spawning very many threads due to a bug, eating up memory, causing heavy swapping to the swap partition. Thus, I switched off swap – which is recommended in server ...
2 votes
1 answer
5k views

Delete a file that was created with fallocate

I started to create a swapfile. I used this command: sudo fallocate -l 1G /swapfile Then, I decided that I want to make the swapfile in a different path, so I used the command again with the right ...
8 votes
2 answers
4k views

Linux OOM disk I/O. Also: swap, what is it good for?

I'm having problems with the OOM killer on one of my Linux (2.6.37) installs. The computer has 4GB of memory which I sometimes utilize fully. In those cases, I expect the OOM handler to come in and ...
1 vote
1 answer
2k views

dd using all memory and swap

I have a dedicated Centos 6.9 linux server with a company that crashed due to hardware failure and has been restored with the old HDD's on a usb caddy. I am trying to move lvm partitions over to the ...
13 votes
11 answers
14k views

How big should the swap partition be?

for some years, I've read that it's a good idea to create a swap partition having the double space of my RAM. does it still apply today? or this isn't needed anymore? I have a server with 8 GiB of ...
0 votes
0 answers
1k views

vm.swappiness works differently on CentOS 6 and 7

We have an Hadoop cluster of CentOS 6 (kernel version 2.6.32-504.el6.x86_64) and CentOS 7 (kernel 3.10.0-327.el7.x86_64) servers . All the nodes are configured with a swapinness of 1. All nodes have ...
14 votes
4 answers
12k views

Linux: Where to put the swap file

Are there any conventions on where to put swap files on Linux? I usually just create them in /var/swapfile, but that seems a bit too high up in the hierarchy.
4 votes
0 answers
722 views

AWS ElastiCache Redis - Why has SwapUsage slowly climbed just over 100MB dispite having FreeableMemory available?

Starting around 7/28/2017 the SwapUsage started to climb for reasons I cannot figure out. I have spent many hours Googling and reading AWS documentation. At no point do we run out of FreeableMemory. ...
5 votes
5 answers
7k views

How much swap do you allocate for your Solaris server?

I'm still seeing system administrators using the old rule of thumb that swap should be double the memory, even in servers with 32GB of memory. These systems have relatively expensive disks (shipping ...
-1 votes
1 answer
525 views

Volatile Linux with a huge tmpfs and swap partition

I want to deploy Linux on user computers in a way state is never preserved between boots (except state saved explicitly by users on external removable devices). System image will be stored on a read-...
0 votes
2 answers
558 views

Try to empty buffer and cache

I try to clear the cache and buffer. Because they grow very much and starting use some swap. Will it affect the system? The system running in production. Or is there any other solution? Memory ...
-1 votes
1 answer
1k views

Linux - Use disk as RAM [closed]

I have a VM and in it a process that consumes a lot of memory (~200GB). Some sort of in-memory DB. I need to run it on a standard laptop and I cannot recompile it or see the code. I've added 256GB of ...
2 votes
1 answer
2k views

I loose the swap every time I restart my Ubuntu server

Here is how I set the swap: sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1MB count="1000" sudo /sbin/mkswap /var/swap.1 sudo /sbin/swapon /var/swap.1 Every time I reboot/restart the swap is gone. ...
6 votes
4 answers
3k views

How to enable swap with salt stack?

How can I create and enable permanent 1GB swap file with salt stack that will work after reboot? salt.states.mount.swap does not allow to define swap size. Furthermore I need to define swappiness. ...
0 votes
1 answer
182 views

Server responsiveness and swapping

I know how swapping basically works, why it's automatic and why it's generally a good thing. There is, however, a common scenario where I wish I had more control. I write LOB web applications with ...
0 votes
1 answer
528 views

coreos: Why is there no default swap partition?

The standard install of coreos seems to come without a defined swap partition and swap setup. What is the reason for that? Would it be recommended do add swap space in coreos node, which works as ...
12 votes
2 answers
21k views

How to find what is using linux swap or what is in the swap?

I have virtual linux (Fedora 17) server with 28GB RAM and 2GB swap. The server is running a MySQL DB that is set up to use most of the RAM. After some time running the server starts to use swap to ...
5 votes
4 answers
6k views

How to check the content of swap memory in Linux?

I am trying to find out what exactly uses swap memory in my system. Free reports over 5GB of used swap memory, but all processes use only 24MB of swap. I suspect that swap might be used by a tmpfs ...
1 vote
1 answer
820 views

RAID-10 for swap: Optimal chunk size

I would claim that if I had a RAID-10 array which is used as swap device only, a chunk size of 4K would be perfect as it matches the page size. Am I right?
1 vote
2 answers
3k views

docker container + java application -> swap used -> why?

There is docker container with java application inside. docker inspect dbc237493367 | grep -P '((Memory)|(Pid))' "Pid": 16283, "PidMode": "", "Memory": 10737418240, "KernelMemory": 0, "...
0 votes
0 answers
327 views

Red Hat Enterprise Linux 6 lvremove succeeds but causes system to not boot

I started with a fresh install of RHEL 6, and it created a default swap as a logical volume (/dev/vg_hostname/lv_swap), along with the root (/dev/vg_hostname/lv_root) mounted as / I then created a ...
10 votes
2 answers
7k views

Is there ever a reason to use tmpfs instead of or in addition to zRAM?

I'm thinking about using zRam on my server. From what I've read about zRam, it apparently does everything tmpfs does and more. Once zRAM is working, is there any reason to keep tmpfs around? Is there ...
40 votes
5 answers
11k views

Should I be concerned that swap is being used on a host with nearly 40GB of free memory?

I have a production host, below: The system is using 1GB of swap, while maintaining nearly 40GB of free, unused memory space. Should I be concerned about this, or is it mostly normal?
3 votes
2 answers
727 views

Is adding Swap on a server with an SSD discouraged?

In this tutorial Digital Ocean explain how to enable swap on Ubuntu 14.04. I arrived at this article after experiencing some issues with my server and this looked like it could help. However, they ...
20 votes
5 answers
53k views

How do I change swap partition in Linux?

How do I change swap partition in Linux? If I currently use /dev/hda3 for swap, and I rather would like to use /dev/hda4, which steps should I go through?
0 votes
1 answer
951 views

adding new partitions to a device the containing root partition [closed]

On virtual box, I have my root file system mounted on the LVM: # df -h | head -n 2 | tail -n 1 /dev/mapper/cl-root 1.5G 951M 404M 71% / The LVM is mounted on /dev/sda2, and /dev/sda has the ...
-1 votes
1 answer
2k views

Linux swap file not being used [duplicate]

One of my database server running mysql/debian is out of memory. I added a swap file but as far as I know it's not used by the system. I can confirm that the swap is enabled when I execute the free -...
1 vote
1 answer
294 views

Database files and the system swap space on the same disk?

Why is it problematic to configure the database files and the system swap space on the same disk? What can happen?
1 vote
1 answer
187 views

Can swapped memory be read directly by java?

When the kernel swaps stuff to disk, can this data be subsequently read by the process directly from swap? or it must absolutely be put back into physical ram (thus generating si so activity in vmstat)...

1 2
3
4 5
7