About PHP_FCGI_MAX_REQUESTS and lighttpd

If you are running PHP on a limited-resource box, like a VPS then you may have seen your PHP pages randomly hang. I was able to trace this issue down because the PHP pages were hung up and the normal html pages were still being served. The problem was ‘solved’ when I restarted the web server. Some research later, and talking to Thilo (bangert), I found out about PHP_FCGI_MAX_REQUESTS. This is an environment variable that PHP respects, it basically tells how many requests to serve before respawning fcgi. In my case, 500 seemed like a good number after testing. Your mileage may vary, but it is worth a try if you have those symptoms.


%% cat /etc/lighttpd/mod_fastcgi.conf
server.modules += ("mod_fastcgi")
fastcgi.server = ( ".php" =>
    ( "localhost" =>
        (
            "socket"   => "/var/run/lighttpd/lighttpd-fastcgi-php-" + PID + ".socket",
            "bin-path" => "/usr/bin/php-cgi",
            "max-procs" => 2, # default 4
            "bin-environment" => (
                "PHP_FCGI_CHILDREN" => "2", # default 1
                "PHP_FCGI_MAX_REQUESTS" => "500" #default 1000
            )
        )
    )
)

Gentoo: devtmpfs and boot times (revisited)

There was alot of of talk/flames on the LKML about devtmpfs. Looks like a big push for this was for embedded devices, android, etc. Since I read that it may give a boot time speed up, I was slightly intrigued. http://lkml.org/lkml/2009/4/30/182, yes…it is an old topic but it finally was released in stable .32 kernel.

So, bootcharts:
bootchart-2.6.31.6.png 39 seconds
bootchart-2.6.32-no-devtmpfs.png 37 seconds
bootchart-2.6.32-devtmpfs.png 37 seconds
bootchart-2.6.32-openrc.png 26 seconds (devtmpfs)

So, where is the real win here? Well, as I wrote before, use openrc.

Gentoo on Acer Aspire1, including binpkgs

About a month ago, I installed Gentoo on the new-to-me Acer Aspire1. Installation went like anything else, it is just a normal x86 host after all. I don’t have everything on it working, because I don’t care. If you are looking for additional resources on getting the extras working, you may want to look here or here.

The exciting part, that I got working and am ready to announce publicly, is my new atom-x86 binpkg repo. What makes this repo different than the binpkgs located on tinderbox.dev.gentoo.org/default-linux is that this repo has CFLAGS specific to the Intel Atom processor. I identified the compiler flags by using the following gcc command: gcc -Q --help=target -march=native and set the following -march=prescott -mtune=generic -msahf. On my linode (review) host, I have a chroot that builds all new packages in my world file once a day which comes from the aspire1. In this manor, I am able to always have binary packages available to me whenever I update my aspire1. Now, I have all the benefits of a source distro and the speed of a binary distro. :)

If you would like to use this repo, set PORTAGE_BINHOST in /etc/make.conf and add ‘getbinpkg’ to FEATURES (or use the emerge options directly). Be advised, that thought this works for me, I make no guarantees for you.

PORTAGE_BINHOST="http://tinderbox.jolexa.net/atom-x86/"
FEATURES="${FEATURES} getbinpkg"

I also have an html view of the packages available.

Gentoo: Genesi Efika MX unboxing and first impressions.

In the mail today, I got the Efika MX Open Client. My first impressions are pretty good. No noise and no moving parts, it should last for a long time. It comes with Ubuntu 9.10 minimal on it out of the box.

That HDMI output makes it the best text console I have ever seen on my 40″ 1080p LCD TV! :) Seriously though, on my TODO:

  • Analyze the possibilities for a HTPC. This will be just something fun to do.
  • Gentoo Prefix on ARM. This will be the first time, that we know of, that it has been attempted. It shouldn’t be that hard because Gentoo already has ARM support which means that most apps already work.
  • Install Gentoo Linux on it and help armin76 document the installation process.
  • Assisting the Gentoo ARM team with providing binary packages and weekly stages for Gentoo Linux users.
  • And more…
Size comparision of Efika MX vs Aspire1

Size comparision of Efika MX vs Aspire1

efika-back

Back of the Efika MX. Power, HDMI, Ethernet, headphone, mic

efika-front

Front of Efika MX. USB, USB, SD Card Slot

FL4SH – A new seeqpod

It has been months since seeqpod was shutdown. I have finally found fl4sh.com. I took this recommendation/review and went ahead and signed up for an account. After all, I needed a pandora replacement after they limited free listening to 40 hours per month! Now, if I only had my saved seeqpod playlists! Oh well, rock on.

screenrc – easy way to improve screen usability

I’ve used a custom ~/.screenrc file for at least a year now. I find that this snippet helps improve the usability for me.

#Custom Stuff
caption always "%{= wb}$USER @ %H >> %-Lw%{= r}%50>%n* %t%{-}%+Lw%< %-=<< (%c.%s)"

activity "%c activity -> %n%f %t"
bell "%c bell -> %n%f %t^G"
vbell_msg " *beep* "

startup_message off

defscrollback 500

multiuser off
# Always start screen with utf8 enabled. (screen -U)
defutf8 on

Output (caption at bottom):
screenrc

Gentoo Prefix: How I survive work…

As Dan writes, I too survive work by using Gentoo Prefix.

%% uname -a
HP-UX localhost B.11.31 U 9000/800 HP-UX
%% gcc --version
gcc (GCC) 4.2.4 (Gentoo 4.2.4-r01.2 p1.1)
%% bash --version
GNU bash, version 4.0.35(1)-release (hppa2.0n-hp-hpux11.31)
%% ls --version
ls (GNU coreutils) 8.1
Packaged by Gentoo (8.1 (p1))

Thanks to haubi for putting effort into the necessary upstream changes/patches for hppa-hpux support!

Buggy MTRR on Acer Aspire One ZG5

The problem:

$ dmesg |grep mtrr
mtrr: no more MTRRs available

I found on my ‘new-to-me’ AA1 that MTRR handling in the BIOS was messed up. Thanks to this bug report I figured out that I should compile the kernel with MTRR sanitizer enabled. That is:

$ zgrep -i MTRR /proc/config.gz
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1

And output of /proc/mtrr is as follows. Before and after.

$ cat /proc/mtrr
reg00: base=0x0fffe0000 ( 4095MB), size=  128KB, count=1: write-protect
reg01: base=0x0fffc0000 ( 4095MB), size=  128KB, count=1: uncachable
reg02: base=0x000000000 (    0MB), size=  512MB, count=1: write-back
reg03: base=0x020000000 (  512MB), size=  512MB, count=1: write-back
reg04: base=0x03f800000 ( 1016MB), size=    8MB, count=1: uncachable
reg05: base=0x03f600000 ( 1014MB), size=    2MB, count=1: uncachable
reg06: base=0x03f500000 ( 1013MB), size=    1MB, count=1: uncachable
reg07: base=0x000000000 (    0MB), size=  128KB, count=1: uncachable
after kernel modification:
reg00: base=0x000000000 (    0MB), size= 1024MB, count=1: write-back
reg01: base=0x03f500000 ( 1013MB), size=    1MB, count=1: uncachable
reg02: base=0x03f600000 ( 1014MB), size=    2MB, count=1: uncachable
reg03: base=0x03f800000 ( 1016MB), size=    8MB, count=1: uncachable
reg04: base=0x040000000 ( 1024MB), size=  256MB, count=1: write-combining

This is needed for decent video playback with the on-board Intel 945 video. :)