Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Performance Optimization: Using Ramlog transfer log files to memory     - MySQL5.6.17 compiler installation under CentOS (Database)

- CentOS 6.5 installation Python3.0 (Linux)

- Linux System Getting Started Learning: rename multiple files in Linux (Linux)

- Linux operating system security management skills notes (Linux)

- Linux server security settings to close unused ports (Linux)

- W and uptime command (Linux)

- CentOS 6.5 installation VNCServer implement graphical access (Server)

- Linux Routine Task Scheduler (Linux)

- PHP 7.0 Upgrade Notes (Linux)

- Several Methods of SSH Auto - login (Linux)

- MySQL how to export files with the date format (Database)

- Nginx Keepalived Nginx monitoring scripts (Server)

- Java garbage collection and heap memory layout (Programming)

- Docker build their own private warehouses (Linux)

- Linux disk quota-related instruction (Linux)

- Linux installation skynet issue summary (Linux)

- To install Emacs under CentOS 6.5 (Linux)

- Debian 7.8 system installation and configuration process (Linux)

- How to properly set up a Linux swap partition (Linux)

- About Git (Linux)

  Performance Optimization: Using Ramlog transfer log files to memory
  Add Date : 2018-11-21      
  Ramlog runs as a system daemon. When the system starts it creates a virtual disk (ramdisk), copy the file / var / log down to the virtual disk while the virtual disk is mounted as / var / log. Then all the logs will be updated to the virtual disk. When ramlog restart or stop, you need to log on the hard disk recording will remain in the directory /var/log.hdd. The shutdown time, the log files will be re-saved (ramdisk on) to the hard disk, in order to ensure consistency log. Ramlog 2.x default tmpfs file system, but it can also support ramfs kernel and ramdisk. Use rsync (Annotation: Linux mirror data backup tool) tool to synchronize logs.

Note: If a sudden power outage or kernel crash (kernel panic), the log is not saved into the hard disk will be lost.

If you have enough memory available, but want to log into the virtual disk on the installation ramlog it. It is a notebook users, with a good selection of the UPS system or the system run directly in the flash, you can save time to write the log.

Ramlog operational mechanism and the steps are as follows:

Ramlog by the first daemon (depending on the other daemons you have installed) to start.

Then create a directory /var/log.hdd and hard segments to / var / log.

If you are using tmpfs (the default) or ramfs file system, mount it to the / var / log.

If you are using kernel ramdisk, ramdisk is created in the / dev / ram9 in and mount it to / var / log. By default ramlog occupy all ramdisk memory, the size specified by the kernel parameters "ramdisk_size".

Then the other daemon is started, and the update log in a ramdisk. Logrotate (Annotation: Linux log rotation tool) and ramdisk with the also very good.

Restart (default once a day) ramlog, the directory will /var/log.hdd With rsync and / var / log to keep pace. The frequency of the log is automatically saved by cron: to control (Annotation Linux routine job scheduling). By default, ramlog scheduling tasks placed in the directory /etc/cron.daily.

When the system is shut down, ramlog before the last daemon shut off.

During ramlog closed, / var / log.hdd the files will be synchronized to / var / log, then / var / log and /var/log.hdd are unloaded, and then delete the empty directory /var/log.hdd.

Note: - This article is only for advanced users

Ramlog installed in Ubuntu

We first need to use the following command to download a .deb package from here:

wget http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb
Download ramlog_2.0.0_all.deb installation package is complete, use the following command to install:

sudo dpkg -i ramlog_2.0.0_all.deb
This step will complete the installation, now you need to run the following command:

sudo update-rc.d ramlog start 22345. stop 99016.
Now, in order to update sysklogd initialization, so that it can stop ramlog before running properly closed:

sudo update-rc.d -f sysklogd remove
sudo update-rc.d sysklogd start 102345. stop 90016.
Then reboot the system:

sudo reboot
System restart, run 'ramlog getlogsize' space to get your current / var / log in. On this basis, more than 40% of the allocated space, ramdisk to ensure that there is enough space (space as a whole will be the size of the ramdisk).

Editing boot configuration files, such as /etc/grub.conf,,/boot/grub/menu.lst or /etc/lilo.conf (Annotation: Which specific profile depending on the boot loader may be) to your current kernel new option 'ramdisk_size = xxx', where xxx is the size of the space ramdisk.

Configuration Ramlog

Deb-based systems, Ramlog configuration file located in / etc / default / ramlog, you can set the following variables in the configuration file:

# Value:
# 0 - tmpfs (can be swapped out to the swap partition) - Default
# 1 - ramfs (old kernel can not set the maximum size of the space,
# Can not be swapped to the swap partition, and SELinux is not compatible)
# 2 - Vintage kernel ramdisk
# Maximum memory size can be used for the tmpfs or ramfs
# This value may be a percentage or value (in Mb), for example:
# The null value indicates that 50% of the size of the tmpfs / ramfs is the total amount of memory
# More options refer to 'man mount' in 'Mount options for tmpfs' a
# (Added in newer kernels, ramfs support the size limit,
# Although the man said no such mount option)
# This option is only for RAMDISKTYPE = 0 or 1
# In kb Specifies kernel ramdisk size, or use MAX to use the entire ramdisk.
# This option is only for RAMDISKTYPE = 2 Shi
# 0 = off, 1 = on. Record their logs to / var / log / ramdisk
LOGNAME = ramlog
# Own log file name (for LOGGING = 1 Shi)
Calls teststartstop will detail when # 0 = off, 1 = on (set to 1, failed to start or stop
# Written to the log)
Uninstall ramlog in Ubuntu

Open a terminal, run the following command:

sudo dpkg -P ramlog
Note: If you are still running before you uninstall ramlog need to reboot the system to complete the uninstallation job.
- To assign multiple IP addresses NIC on the CentOS 7 (Linux)
- JITwatch installation under Linux (Linux)
- CentOS install SystemTap-2.6 (Linux)
- Under CentOS yum install Nginx smooth switch mounted to Tengine (Server)
- C language Bubble Sort - integer sort (Programming)
- Use ISO document production OpenStack used CoreOS mirror (Linux)
- Java semaphores (Programming)
- xCAT line installation on CentOS 6.X (Linux)
- Applications in Objective-C runtime mechanism (Programming)
- Ubuntu Install OpenSSL (Linux)
- Python basis: os module on the file / directory using methods commonly used functions (Programming)
- STL spatial Configurator (Programming)
- Ubuntu 14.04 / 12.04 subscribe users to install software Liferea 1.10.10 (Linux)
- JavaScript prototype and the prototype chain (Programming)
- CentOS Linux firewall configuration and Close (Linux)
- C language macro definition #define Usage (Programming)
- Qt shared memory interprocess communication (Programming)
- Arronax allows you to easily create desktop startup file (Linux)
- Confrontation dragged Library - Web front-end encryption slow (Linux)
- How to merge two pictures in Cacti (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.