When adding Zabbix monitoring to the server, it was found that the server had an error "Lack of free swap space on localhost", by looking to know that when installing the server forgot to divide the swap partition. To reduce the error, now directly divide the swap partition, the following steps:1, create a
the parted command, enter print to view the current partition table, as well as the free space. The start and end values are in megabytes, then calculate how much free space you have and how much space you want to divide into the swap partition.At the parted prompt, enter Mkpartfs part-tyep
directly from the file system without calling from swap.
In the early days it was often observed that swap could not exceed 128M, Now our server generally does not exist this problem can swap to 2048M most. The structure of the swap space file is the size of each page of p
= Blocks skips the Ibs*blocks block at the beginning of the read buffer.
Obs = bytes Writes bytes bytes At a time, that is, the number of bytes written to the buffer.
BS = bytes Sets the number of bytes in the read/write buffer (equal to setting IBS and OBS).
CBS = byte convert bytes byte at a time.
Count=blocks only copies the input blocks blocks.
Example
"Add Swap to VPS"
Typically only applies to
How to add SWAP partitions for 512 m Centos
This tutorial uses centos as an example to add swap memory to a LINUX server with small memory.
1. Create a cache file directory or directly go to the var directory:
Cd/var
2. Obtain the
After determining the memory used by the server, we need to increase the swap space by MB.Specific operations:1. dd If =/dev/Zero of =/tmp/swap BS = 1 m COUNT = 1024 M # create a file block of m2. mkswap/tmp/swap # create a swap file3. Swapon/tmp/
. (for example, # fdisk/dev/sdb) remove the swap partition and enter d to delete the swap partition, then add n partitions (the hard disk must have available space when adding the partition, and then use t to change the newly added partition id to 82 (linux
The swap partition in Linux is similar to Windows virtual memory, in the case of insufficient hard disk space, can be created by the swap partition to solve, the following small series to introduce you to the Linux how to create and delete the
are two ways to create a swap:
Create a new disk partition as a swap partition
Use a file as a swap partition
Create a new disk partition as a swap partition
Partition the disk with the Fdisk command, add a sw
The current disk partitions and swap partitions are as follows:
[Root@bys3 ~]# Fdisk-l
disk/dev/sda:21.4 GB, 21474836480 bytes
255 heads, Sectors/track, 2610 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 104391 Linux
/dev/sda2 2078 16587112+ Linux
/dev/sda3 2079 2600 4192965
, accidentally will cause L to use swap. This scenario is more common, and the following are the simplest three adjustment methods:1,/proc/sys/vm/swappiness content changed to 0 (temporary),/etc/sysctl.conf add vm.swappiness=0 (permanent)This parameter determines whether Linux is inclined to use swap or is disposed to
How to modify the swap partition size after installing Linux
The testing test is RH AS4If you are not sure what swap is, or the concept of partitioning, the following procedure may be of some risk to you.It is also more convenient to enlarge your own swap. You must have root permission, the process must be very careful
programs or system modules require 6 GB of memory, the operating system may map some of the address space of MySQL to swap.
When cp is a large file or mysqldump is used to export a large database, the file system will usually apply for a large amount of memory from Linux as the cache. If you are not careful, L will use swap
Modify the size of the swap partition (two methods) after you install the Linux systemAfter installing the Linux system, the swap partition is too small, how can I expand the swap partition? There are two ways, one is to create a new swa
following are the three simplest adjustment methods:
1. Change the/proc/sys/Vm/swappiness content to 0 (temporary), and add VM. swappiness = 0 (permanent) to/etc/sysctl. conf)This parameter determines whether Linux prefers to use swap or release the file system cache. When the memory is tight, the lower the value, the more inclined it is to release the file syst
Modify the size of the swap partition (two methods) after you install the Linux systemAfter installing the Linux system, the swap partition is too small, how can I expand the swap partition? There are two ways, one is to create a new swa
following are the three simplest adjustment methods:
1. Change the/proc/sys/vm/swappiness content to 0 (temporary), and add vm. swappiness = 0 (permanent) to/etc/sysctl. conf)This parameter determines whether Linux prefers to use swap or release the file system cache. When the memory is tight, the lower the value, the more inclined it is to release the file syst
After installing the Linux system to modify the size of the swap partition (two ways) after the installation of the Linux system, the swap partition is too small, how to expand the swap partition? There are two ways, one is to create a new
Tags: sysctl efficiency int two times mechanism HDD technology share buffers addToday we will talk about the memory mechanism of Linux.First, let's take a look at the conceptFirst, what is the memory mechanism of Linux?We know that reading and writing data directly from physical memory is much faster than reading and writing data from a hard disk, so we want all of the data read and written to be done in memory, and memory is limited, which leads to t
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.