[This is yet another article in a series, feedback needed]
ColdFusion Server 5 on Linux: Kernel Considerations
Generally, people tend to ask what kernel Macromedia reccomends you
run on a Linux system to gain optimal performce. This paper will go over
current kernels and distributions, covering key items customers should
evaluate when choosing botha a distribution and the kernel. Back when we
originally ported to Linux, the answer was not clear, as the kernel was
still in the 2.2.x branch, and performance and stability were pretty much
equal across versions (except for earlier kernel revisions).
However, this field changed significantly when the 2.4 kernel came
out (as of this writing, the most recent stable kernel is 2.4.10). The 2.4
kernel series has a myriad of features that would allow greater speed and
stability across the etnire Linux system, and lending many of these new
improvements to ColdFusion server.
A quick rundown of some of the key alterations in the 2.4.x kernel:
CPU scalability:
Less use of the global lock_kernel
More subsystem based spinlocks
Spinlocks embedded in data structures
Semaphores used to serialize address space access
More of a spinlock hierarchy established Lock granularity has a tradeoff
though: the more fine grained you get, the less lock Contention you have,
but the more overhead you get because of all the locks you need to go
through of any single operation.
The hard part is to find the sweet spot in the number and location of locks,
and obviously this depends on how many CPUs you Have in your target
platform. Right now, 4 CPUs is the 'sweet' spot in linux 2.4
Multithreading improvements:
Multiple threads can access address space specific data structures
simultaneously
Single mmap_sem semaphore was replaced with multiple reader/single writer
semaphore (down_read/down_write operations)
A reader lock is now acquired for reading per address space structures
Exclusive write lock is acquired when altering per address space structures
Increased number of threads and tasks
Maximum allowable number of tasks/address spaces as well as threads was
increased
Configuration of maximum number of threads is runtime tunable via /proc
filesystem (no more NR_TASKS)
Scheduler optimizations minimize overhead of context switching between
sibling threads
Bigmem for IA32
1GB physical memory limitation in the linux kernel
4GB physical meory limitation for 32bit systems
4GB physical memory optimizations in the linux kernel
64GB physical memory using PAE on IA32
Disks and filesystems
File size increase
File offset was increased from 31 bits to 44 bits in the VFS layer
Filesystem size and file size are increased to 16TB
Buffermem and pagecache were merged in 2.4 to unify fs cache
Raw IO
Journaling filesystems (ext3, reiserfs, xfs, jfs)
Logical volume manager included in the main kernell
Working NFS V3 (udp only in the stock kernel)
Other miscellaneous
Fast memory transferts for Pentium, AMD, Cyrix, Winchip and a few others
*network rewrite to optimal performance and better use of SMP systems*
Kernel based http daemon (khttpd)
Iptables/Netfilter replacement for ipchains
Tunable memory parameters (/proc/sys/vm/)
The key features that allow ColdFusion server to operate better are
the Multithreading improvements, Raw I/O (calling files from the disk), and
the new networking features.
At this time, Macromedia does reccomend that you do in fact, run the
2.4.x series of kernels. The primary factor for many decisions however is
compatibility and support. Currently, Red Hat and SuSE (both supported by
Macromedia) have integrated the 2.4.x kernel into thier distribution.
So far, internal tests have shown both an increase in response time,
and in stability with these newer distributions.
If you are going to recompile your kernel by hand, there are a few
features that you might want to include in your compile such as:
Loadable module support (However, you should try to compile as much
as possible directly into the kernel, that way, you don't have to worry
about module loading overhead, however slight it might be)
Processor Type and features (You should compile a kernel optimized
for you processor type, this will increase system speed)
*Note: As for devices, you should only compile in support for the
devices you need, keep the kernel nice and trim*
Networking Options:
Turn on IP: TCP Explicit Congestion Notification
support
Kernel Hacking:
Turn on: Kernel Debugging
Turn on: Debug memory allocations
Turn on: Memory mapped I/O debugging (NEW)
(These may increase some overhead, but will allow for better
troubleshooting capability)
PLEASE NOTE: There is a catch. If you are worried about being able to
adequatly debug problems when they arise (crashes, coring, etc) you will
more than likely need to grab a '-ac' branch of the kernel. If you are a Red
hat user, Red Hat ships with a '-ac' branch by default. At this time, the
'-ac' kernel branch is the only one supporting core.pid files (allows for
thread core debugging). Please read the KB article: ColdFusion Server 5:
Troubleshooting ColdFusion Core Dumps and Crashes on Linux (
http://www.allaire.com/Handlers/index.cfm?ID=21911&Method=Full ). More
information on the '-ac' pacthes can be found at:
http://www.kernelnewbies.org/faq/index.php3#acpatches.xml
Please remember, kernel recompilation and installation is not
supported by Macromedia. If you have issues, below are some links which may
help you:
Upgrading the Linux Kernel on Red Hat Linux systems
http://www.redhat.com/support/resources/howto/kernel-upgrade/kernel-upgrade.
html
Kernel Newbies
http://www.kernelnewbies.org/
Linux 2.4 Status/TODO Page
http://linux24.sourceforge.net/
OOPS! An Introduction to Linux Kernel Debugging
http://www.urbanmyth.org/linux/oops/
Questions and comments should be sent to [EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-linux%40houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_linux or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.