Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This post led me to ask that question.

Cache contention

On a large site, if you are using MyISAM, contention occurs in the database tables when the cache is forced to clear after a node or a comment is added. With tens of thousands of filter text snippets needing to be deleted, the table will be locked for a long period, and any accesses to it will be queued pending the purge of the data in it. The same is true for the page cache as well.

This often causes a "site hang" for a minute or two. During that time new requests keep piling up, and if you do not have the MaxClients parameter in Apache setup correctly, the system can go into thrashing because of excessive swapping.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Swapping is what happens when the programs you're running allocate more memory than your machine's physical RAM. Some of the data is swapped out to disk, and swapped back in when it's needed.

This is ok as long as it doesn't happen too often. Disk access is much slower than RAM access, so every time the computer has to swap, the program that caused it will have to pause while the data is transferred.

Excessive swapping (also called thrashing) is what happens when the amount of memory the programs are actively using exceeds the amount of physical memory. The computer spends all its time swapping data between disk and RAM, and little time actually accomplishing any work.

In the article you mention, the problem was that too many Apache processes were forked. Each process requires some memory, and if MaxClients is set too high, Apache will keep forking child processes until it brings the system to a crawl.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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