Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In particular, I'm wondering if there are any patches or config adjustments made to the disk cache size in the server edition. I'm running on a small system (256M RAM), and would like to experiment with keeping the disk cache size smaller so that there's more memory available for applications.

I've found this page at Ubuntu's website, which neither answers my questions nor is about the 9.04 release.

share|improve this question

4 Answers 4

up vote 4 down vote accepted

I'm guessing the difference is mostly in the fact that the server kernel is not preemptive, like the desktop kernel is. This is a bit complicated:

Preempting means kicking process A from the CPU in favor of process B, in simple terms. End-users expect a responsive system. Therefore, a desktop will run a preemptive kernel, which can favor user interaction above running programs. This means that the kernel can 'kick' a background program, favoring a user program by granting it runtime on the CPU, even before the background program's timeslice is over and before the background program yields the CPU.

A server on the other hand, is built to run a couple of programs in the background (like Apache) and not to interact with a user. Therefore, a server will run a non preemptive kernel, and so be optimized for running programs in the background.

You can read a bit about Ubuntu kernel configuration here. The article is a couple of years old, but I'm pretty sure the preemption bit is still one of the biggest differences between Ubuntu's desktop and server kernels. Another difference is the choice of I/O scheduler: the server uses the deadlines scheduler, the desktop the CFQ. Admittedly, I took that from the linked article.

As for disk cache, Linux caches. Period. Linux will happily use all of your RAM as disk cache. It doesn't matter if you have 512MB of RAM or 1GB of RAM: Linux will use it if it sees fit to. There is not tweaking of this that I am aware of.

Also know that there is no downside to this: as your programs require more RAM, less RAM will be used for cache. The fact that your VM has 256MB only and that some of that is used as cache, will not hamper performance of your programs: if the programs request RAM, they will get it instantly, at the cost of having less cache. That is a Good Thing TM. Again: memory used as cache is still available to your applications. It will be reclaimed instantly and giving to a memory hungry application if the kernel thinks that appropriate. Running a different kernel will not change this.

share|improve this answer
    
OK, that makes sense (re: caching). Is it true that if there are cached pages that are "dirty", they'll have to be flushed to disk (or to the disk's hardware cache) before the memory can be reclaimed for application usage? –  dcrosta Sep 30 '09 at 15:26
1  
You are mistaking cache for buffers there. Buffers would show that behaviour, I guess. Buffers are pages in memory waiting to be written to disk, a sort of 'write cache', whereas what you see as 'cache' in the output of 'free' is 'read cache': pages read from disk that remain in memory for convenience sake. –  wzzrd Sep 30 '09 at 15:33
    
Ah, thanks. Some of this jargon is fairly confusing. –  dcrosta Sep 30 '09 at 16:06
    
I believe there is one important tunable parameter that relates to cache. The swappiness (/proc/sys/vm/swappiness). This decides to what degree application memory will be swapped out to allow for more cache. –  Roy Oct 8 '09 at 18:41
1  
Hmm, "a desktop will run a preemptive kernel" while "a server will not run a non preemptive kernel". Either there is no difference or one of these assertions should be corrected (presumably the second one). –  jlliagre Nov 15 '11 at 9:53

One important thing I found when trying to use >2GB of ram on my laptop, which was running 32 bit Ubuntu with a desktop kernel. Replacing the desktop kernel with a server kernel, enabled PAE, so it could address more memory. In the end, I ended up putting 64 bit Ubuntu on it instead.

share|improve this answer

It appears that mostly the differences are related to the clock, pae, and xen.

--- config-2.6.28-15-generic    2009-09-09 05:56:49.000000000 -0700
+++ config-2.6.28-15-server 2009-09-09 06:13:24.000000000 -0700
@@ -3659,7 +3659,7 @@
 CONFIG_UWB_WHCI=m
 CONFIG_UWB_WLP=m
 CONFIG_V4L_USB_DRIVERS=y
-CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.28-15.52-generic"
+CONFIG_VERSION_SIGNATURE="Ubuntu 2.6.28-15.52-server"
 CONFIG_VETH=m
 CONFIG_VFAT_FS=m
 # CONFIG_VGACON_SOFT_SCROLLBACK is not set
@@ -3932,34 +3932,41 @@
 # CONFIG_ZONE_DMA32 is not set
 CONFIG_ZONE_DMA_FLAG=1
 #
-# Config options for config.generic automatically generated by splitconfig.pl
+# Config options for config.server automatically generated by splitconfig.pl
 #
-# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
-CONFIG_DCA=m
-CONFIG_DEFAULT_CFQ=y
-# CONFIG_DEFAULT_DEADLINE is not set
-CONFIG_DEFAULT_IOSCHED="cfq"
-CONFIG_DMADEVICES=y
-# CONFIG_DMATEST is not set
-CONFIG_DMA_ENGINE=y
-CONFIG_HIGHMEM4G=y
-# CONFIG_HIGHMEM64G is not set
-CONFIG_HZ=250
-# CONFIG_HZ_100 is not set
-CONFIG_HZ_250=y
-CONFIG_IGB_DCA=y
-CONFIG_INTEL_IOATDMA=m
-CONFIG_IXGBE_DCA=y
-# CONFIG_LGUEST is not set
-# CONFIG_LGUEST_GUEST is not set
-CONFIG_M586=y
-# CONFIG_M686 is not set
-CONFIG_MYRI10GE_DCA=y
-CONFIG_NET_DMA=y
-# CONFIG_PHYS_ADDR_T_64BIT is not set
-# CONFIG_PREEMPT_NONE is not set
-CONFIG_PREEMPT_VOLUNTARY=y
-# CONFIG_RESOURCES_64BIT is not set
-CONFIG_X86_ALIGNMENT_16=y
-CONFIG_X86_E_POWERSAVER=m
-CONFIG_X86_F00F_BUG=y
+CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_DEADLINE=y
+CONFIG_DEFAULT_IOSCHED="deadline"
+# CONFIG_HIGHMEM4G is not set
+CONFIG_HIGHMEM64G=y
+CONFIG_HVC_IRQ=y
+CONFIG_HVC_XEN=y
+CONFIG_HZ=100
+CONFIG_HZ_100=y
+# CONFIG_HZ_250 is not set
+CONFIG_I2O_EXT_ADAPTEC_DMA64=y
+# CONFIG_M586 is not set
+CONFIG_M686=y
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_RESOURCES_64BIT=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_CMPXCHG64=y
+CONFIG_X86_DEBUGCTLMSR=y
+# CONFIG_X86_DS is not set
+# CONFIG_X86_E_POWERSAVER is not set
+CONFIG_X86_PAE=y
+CONFIG_X86_TSC=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_XEN=y
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_BLKDEV_FRONTEND=m
+# CONFIG_XEN_DEBUG_FS is not set
+CONFIG_XEN_FBDEV_FRONTEND=m
+CONFIG_XEN_KBDDEV_FRONTEND=m
+CONFIG_XEN_MAX_DOMAIN_MEMORY=8
+CONFIG_XEN_NETDEV_FRONTEND=m
+CONFIG_XEN_SAVE_RESTORE=y
+CONFIG_XEN_SCRUB_PAGES=y
share|improve this answer

An update since this has changed in Ubuntu 12.04 Precise:

Since 12.04, there is no difference in kernel between Ubuntu Desktop and Ubuntu Server since linux-image-server is merged into linux-image-generic.

Source: https://help.ubuntu.com/community/ServerFaq

Discussion about this can be found on: https://lists.ubuntu.com/archives/kernel-team/2011-October/017471.html

share|improve this answer

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.