Linux configuration for an ancient Thinkpad

Discussion in 'all things UNIX' started by Gullible Jones, May 26, 2012.

Thread Status:
Not open for further replies.
  1. Let's say you wanted to to make a Thinkpad 600E - with an almighty Pentium II processor and 192 MB of RAM - useful for browsing and word processing. And you wanted it to run a secure and reasonably user-friendly modern OS. How would you configure it?

    What I've managed to deal with so far:

    - Swapping. Too much swapping can be mostly avoided by using zram, which sacrifices CPU power for effective memory.

    - Slow GTK apps. Again, zram helps. So does using Fluxbox with outline move/resize, and disabling unnecessary eyecandy GTK themes.

    What I haven't managed to deal with:

    - Slow application start times. To some extent this is unavoidable what with the slow hard drive, but cross-platform applications are ~50% faster to start on Windows (2000 or XP) than on Linux. I suspect this is due to the proliferation of shared libraries; not sure what can be done about it (other than prelinking, which I've never found effective).

    - Slow Qt applications. Using the raster graphics system helps, but not enough to make them in any way usable. Maybe they're a lot cause...

    - CPU priority issues. Background tasks can hog too much CPU time, slowing everything down. Since multitasking is necessarily going to suck on a Pentium II, I figure it would be better to assign higher CPU priority to whatever is in the foreground... Yes, like on Windows. That way you could get one application at a time running with reasonable responsiveness. Unfortunately I have no idea how that could be done on Linux.

    Ideas are welcome...

    (And yes, my hobbies are strange. I know.)
     
  2. Hungry Man

    Hungry Man Registered Member

    Joined:
    May 11, 2011
    Posts:
    9,148
    192MB of RAM... yikes... and not even a P4

    Honestly I'd turn it into a Firewall/IDS/IPS so check out pfsense.
     
  3. I had thought a 2.4 kernel might work, but Damn Small Linux was actually slower on it than any other distro. Best so far is Puppy Linux, but that has... issues. Also, Abiword is totally unusable on it due to the smooth scrolling bug.

    ... Then again, Abiword is unusable on every Linux system I've ever used because of that bug, so I'm not sure why I'm bothering. OS without word processor = completely useless.
     
  4. Hungry Man

    Hungry Man Registered Member

    Joined:
    May 11, 2011
    Posts:
    9,148
    Dive into Arch. Optimize...
     
  5. mirimir

    mirimir Registered Member

    Joined:
    Oct 1, 2011
    Posts:
    6,029
    Have you looked at Tiny Core Linux?
     
  6. That's a thought. Unfortunately Arch is in the process of swapping in bloaty GTK3 applications for everything. (Welcome to the future. :p) I might give it a go though.

    BTW, have you ever found compile optimizations to be useful on old computers? The only one I've ever found effective is -fomit-frame-pointer (which frees up a register, but breaks debugging on x86-32). Other than that one I've never found any to make the slightest difference, and certainly not to make up for the time spent compiling.
     
  7. Hungry Man

    Hungry Man Registered Member

    Joined:
    May 11, 2011
    Posts:
    9,148
    Actually optimization probably won't do **** for you since a P2 isn't exactly built with modern instruction sets.

    Instruction sets can make a massive difference or none at all. It's about the program, really.

    PCSX2 and Dolphin are optimized and can be compiled for SSE2/3/4 and the difference can be massive. There are areas of games where you'll get 4x the framerate purely because instead of no instruction sets you've used SSE4.

    edit: I compile my kernel with every instruction set available on my CPU. I haven't noticed anything different. Maybe I would if I were on an older P4 or if I were doing some crazy stuff on it but I'm not. If you were to use Gentoo and compile everything with instructions... yeah, maybe there'd be some big difference.
     
    Last edited: May 27, 2012
  8. mack_guy911

    mack_guy911 Registered Member

    Joined:
    Mar 21, 2007
    Posts:
    2,677
    well on this lubuntu or maybe xubuntu as well work as ram is very less you can check lxde base distro as puppy linux you can install office suite in it



    https://en.wikipedia.org/wiki/Lightweight_Linux_distribution

    as security you can set firewall in it as well its more than enough for basic security :)

    or

    can try bodhi linux as well
     
  9. Xubuntu is probably too heavy. Lubuntu? Maybe. It wouldn't be snappy by any means, but it would probably work.

    (If I used the alternate installer. Live installer would probably crash.)

    I'm still trying to figure out how I could better optimize Linux for single tasks. Maybe I could increase some of the kernel.sched sysctl settings (e.g. sched_latency_ns) so that foreground applications don't get interrupted?
     
  10. AlexC

    AlexC Registered Member

    Joined:
    Apr 4, 2009
    Posts:
    1,280
  11. Beavenburt

    Beavenburt Registered Member

    Joined:
    Dec 17, 2006
    Posts:
    566
    Slitaz is what you are after. www.slitaz.org

    IMO it's the best tiny distro out there. It runs in about 50 megs of ram at idle. Give it a try.
     
  12. zapjb

    zapjb Registered Member

    Joined:
    Nov 15, 2005
    Posts:
    3,518
    Location:
    USA - Back in a real State in time for a real Pres
    Puppy Linux!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
  13. I've used Slitaz before. Might try it again for this machine. OTOH zram mostly handles the RAM issue; the main problems I'm focusing on are (apparently distro-independent) CPU scheduling issues. I'd like to tweak CFS to be more friendly to a "one application at a time" approach, giving most available CPU cycles to the piggiest application (because chances are that's the one you want to run fast). IOW the approach should (IMO) be completely different from the preemptive multitasking stuff on a modern desktop, because the Pentium II is more or less incapable of efficiently dividing its attention between two things.

    And Puppy works (exceptionally well at that), but I have issues with its design. Running as root by default is bad, and lack of a sane update path for the full install is very bad.

    (I know that Puppy enthusiasts love to say their distro isn't insecure. But the fact is, two of the biggest causes of malware proliferation on Windows have historically been a) use of administrator accounts by default, and b) inability of users who pirated it to easily update. Puppy has both disadvantages, and ignoring the whole obscurity thing is about as secure by default as a pirated copy of Windows XP Home.)
     
  14. Hungry Man

    Hungry Man Registered Member

    Joined:
    May 11, 2011
    Posts:
    9,148
    Instead of CFS you should try BFS. It's more tuned to single-task scheduling.
     
  15. zapjb

    zapjb Registered Member

    Joined:
    Nov 15, 2005
    Posts:
    3,518
    Location:
    USA - Back in a real State in time for a real Pres
    BFS LOL. Look up "BFS Scheduler". Gotta love Con Kolivas.
     
  16. Hmm, PCLinuxOS uses BFS by default... Shame it doesn't have any installer other than the live one. I will probably give BFS a try at some point though.

    As for CFS, there is this: https://www.kernel.org/doc/Documentation/scheduler/sched-design-CFS.txt

    It looks like what I want is basically to assign the SCHED_BATCH policy to big applications like Firefox... Oh hey wait a minute!

    That looks interesting, but is a rather involved way of assigning CPU time. Maybe it would be better to use something like e.g. verynice? Also I haven't yet tried upping sched_min_granularity_ns, for whatever that's worth.

    Edit: Hmm. I tried setting sched_min_granularity_ns up to 1 second, that seemed to make a difference in terms of interactivity. There's still a delay when typing/backspacing in Midori and Abiword, but I think that may be more an application problem... Also OMG, scrolling in Abiword is actually usable now! Cool.

    I'm guessing the downside of this, though, is that a runaway CPU hog would absolutely kill the system (because it treats CPU eaters preferentially). OTOH, CPU hogs killing the system is business as usual on Linux. :) Still, a renicing daemon like verynice would probably be a better long-term solution - just give "good" applications like Firefox high CPU priority, and make everything else sluggish.

    Edit again: My hypothesis about shared library bloat has (I think) been confirmed - Opera, a large browser with few shared libraries, loads faster than Midori, a smaller browser that uses many libraries. (Specifically, 6 seconds vs. 20 seconds.) Lots of small highly dispersed files = bad news on slow hard drives. This was probably why ReiserFS outperformed everything else back when I was in high school.

    (But I don't touch ReiserFS these days. Call it pragmatism or call it superstition, I won't use it.)
     
    Last edited by a moderator: May 27, 2012
  17. Still looking into this... More so, now that the keyboard on my flimsy EeePC has broken. One thing I'll say about these old machines, they made them *sturdy*.

    Anyway, I think what's most needed on the Thinkpad is some way of reducing disk activity. Linux's habit of scattering thousands of tiny libraries all over the hard drive is killer when the drive is an ATA66 model. Probably what's needed is some way of caching stuff in one place. Either that or an OS along the lines of Puppy or Porteus, that stores the userland in a compressed image.
     
  18. Update: got it working (and currently posting from it).

    I tried a different tack... Instead of using a stripped down Fluxbox desktop, I decided on a full Xfce desktop launched by GDM. And, surprise, it works quite well.

    The OS: SalixOS 13.37, based on Slackware 13.37. "Pure" Slack would probably be faster for various reasons, but I couldn't be bothered (and this machine can't boot from DVDs anyway).

    The partition scheme: 4 GB swap, 8 GB ext4 root, 28 GB ext4 home, in that order. I know, 4 GB is a lot of swap - I'm counting on the kernel paging out as much unneeded stuff as possible.

    The settings:

    - Xfwm4 is set to use outlines for both move and resize. Yes, this freezes the rest of the screen; I don't care. If anything that helps, because the screen doesn't have to update *at all* when moving windows around. Anyway this is probably the most important modification I made to the default settings, since the Thinkpad's Neomagic video card is horribly weak.

    - All partitions are mounted with noatime. Probably not necessary now that relatime is the default, but I don't need atime anyway so what the heck.

    - I'm using the non-SMP kernel, because there's no benefit to using the SMP one, and the extra stuff in it would waste more memory and probably create more overhead.

    - /tmp is on a tmpfs ramdisk. I'm not sure if this helps at all; my hypothesis is that putting the XOrg and Xfce temporary files in RAM will reduce needless disk activity (since those files get accessed a lot according to lsof), and allow more resources to be dedicated to important stuff... like, umm, swapping. Yeah. As I said, I'm not sure this helps.

    - I disabled the XOrg composite extension. It is not useful and not necessary on ancient machines, and nothing should be allowed to use it what with the limited resources.

    - I was careful to make sure all icon caches were built, not just hicolor. (Salix doesn't do this for you automatically.) This makes GTK2 applications quite a bit snappier in my experience. Note that some distros will do this for you, so you don't have to do anything.

    And that's it. Things I did not do include tweaking swappiness, messing with hdparm, and modifying any sysctl variables at all. So far this setup is actually faster than the last one with Fluxbox was, and while not exactly snappy, is quite usable for one task at a time; and can even tolerate having the package manager install stuff in the background, without choking up.

    Not bad for a full, multi-user Linux distro!
     
  19. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,697
    Very nice work ... in fact, if you want, I could write an article on this - you as a guest author, if you care to phrase this a little more around and provide some nice screenshots.
    Mrk
     
  20. Umm. Thanks! :D I'll have to think about that, but it sounds like a cool idea.

    Screenshots might be a problem though. Not so much because the Thinkpad takes 30-40 seconds per PNG screenshot, as because I get artifacts in them, at least when I use Imagemagick.
     
  21. mack_guy911

    mack_guy911 Registered Member

    Joined:
    Mar 21, 2007
    Posts:
    2,677
    yes it would be usefull for everyone of us also when again you needed you need to surf just wilderssecurity post :p
     
  22. When I have some more spare time, I'll see what else can be done...

    - 4 GB swap is a bit extreme, I expect 2 GB would suffice. I think my problem earlier was using swap proportionate to avalable RAM, i.e. more like 512 MB.

    - Reducing swappiness probably would help, but I don't think it's that big a deal. The computer is going to swap no matter what.

    - I'm wondering if there are ways of increasing disk throughput that would work on such an old machine. Or, at least, increasing throughput on swap partitions so as to reduce the impact of swapping a bit. Putting a swap partition on a USB stick is a non-option unfortunately, because it's limited to USB 1.1 speeds (and the Thinkpad has only one USB port anyway).
     
Loading...
Thread Status:
Not open for further replies.