Summary

We aim to define a set of power user tasks to tweak Ubuntu for security, performance, and other needs.

Rationale

There's a lot of nice stuff people should be able to do without being world-class hackers. Understanding the idea of process limits for example is easy enough, and this idea should be useful without having to dig for /etc/security/limits.conf

Use cases

There are many use cases possible.

Scope

Our scope is anything and everything, but in a modular fashion.

Security:

Memory:

Network:

Design

The power user applet should be a modular configuration applet.

Implementation

Code

Data preservation and migration

None yet.

Unresolved issues

Comments from Mark

This place looks about right for my comments. They concern init scripts, tmpfs, fstab, and swap. I hope they become official specifications. Some may relate to the "power app" but most relate to basic system architecture.

Feisty Boot Testing

Please test Feisty bootup under RAM-based configurations. That means tmpfs and/or no swap space. Ubuntu Dapper works with

tmpfs /var/run tmpfs rw 0 0

tmpfs /var/lock tmpfs rw 0 0

but fails with /var/log and /tmp mounted tmpfs. The reason is usually because init script XYZ assumes folder /var/log/XYZ or /tmp/XYZ persists across boots.

The patch is simple and obvious: every init script should test for, and if necessary generate, subdirectories it needs, prior to main execution. This is just defensive coding. Some init scripts at low runlevels and high boot priority have such bugs. Which ones vary by Linux distribution. (I am aware that /var/tmp is intended to persist on disk, but even that should work if mounted tmpfs, though you could defer that spec.)

Performance Tuning for tmpfs

Disk I/O is a major performance determinant. Constant access to /tmp and /var/log hurts. Moving them to RAM makes systems faster. These folders can also jeopardize security (e.g. log files) or just clog disks over time. Tmpfs makes systems faster and keeps them clean.

Tmpfs lacks a wholesale tuning parameter. Fstab can limit each mount individually (size=X), but not all collectively. Debian source implements a hard-wired divide-RAM-by-two constant. That value should be parametric from fstab or some other place.

The advantage is ease of use plus flexibility. Putting limits on each mount individually requires expert knowledge. Even where available, that only works for one usage scenario; there can be many. A general limit will work in all cases. Most users don't know how much /var/log needs, but do know how much RAM consumption they will tolerate for junk before swapping it all to disk.

Half of RAM is a lot. People do not want that much RAM eaten by junk files. So a reasonable upper limit would be, say, 15% of RAM before tmpfs resorts to swap space, instead of today's arbitrary 50% setting. Ubuntu might use some other cap, but the point remains, there's no way to adjust it short of kernel recompilation.

Swap Not Always

Tmpfs should work even when no swap is available, in which case, it behaves like ramfs. Whatever limits fstab placed on it should still be respected.

One can execute "swapoff -a" but Ubuntu should offer some way to configure that automatically for people with lots of RAM.

Noexec and Nosuid

Security: Miscellany temp folders should default noexec, nosuid. Developers are not running that way, so bugs creep in. A well known apt glitch needs this work-around for /etc/apt/apt.conf:

DPkg::Pre-Invoke {"mount -o remount,exec /tmp";};

DPkg::Post-Invoke {"mount -o remount /tmp";};

which should be the default in Ubuntu until such time as apt itself is fixed not to need execution from /tmp.

BoF agenda and discussion


CategorySpec

PowerUserApplet (last edited 2008-08-06 16:31:22 by localhost)