Advanced

Optimization guide for Linux web/db servers

Posted by VISITOR on · Post a comment
Linuxgangster.org; By natas
Mail this story
Print this story

This article should help a Linux system administrator with optimizing a server for Web/Database usage. This article will be usefull for any type of server as it has some general tweaks listed, however the article is geared towards MySQL and Apache 2.*

** The author takes no responsibility for the effect of the use of this guide upon the users computer.

Kernel tweaking

/etc/sysctl.conf is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/

The lines below are some nice tweaks you can use for a heavy loaded server. To add them edit your /etc/sysctl.conf file

kernel.sem = 100 32000 100 100 kernel.shmmni = 4096 kernel.shmall = 2097152 kernel.shmmax = 2147483648 fs.file-max = 65536

To see your current values type the following: sysctl -a |egrep "shmmax|shmall|shmmni|sem|file-max"



Semaphores (kernel.sem)

kernel.sem defines the Semaphores values. Semaphores are counters which are used to provide synchronization between processes or between threads within a process for shared resources like shared memories. System V semaphores support semaphore sets where each one is a counting semaphore. So when an application requests semaphores, the kernel releases them in "sets". kernel.sem as you can see above has 4 values. The four values represent: SEMMSL, SEMMNI, SEMMNS and SEMOPM. SEMMSL defines the maximum number of semaphores per semaphore set

SEMMNI defines the maximum number of semaphore sets in the entire Linux system.

SEMMNS defines the total number of semaphores (not semaphore set) in the entire Linux system. A semaphore set can have more than one semaphore, and according to the semget(2) man page, values greater than SEMMSL * SEMMNI makes it irrelevant.

SEMOPM defines the maximum number of semaphore operations that can be performed per semop(2) system call.

Full article can be read here.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Community

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments

No comments yet. Be the first.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post