Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Dramatic perl + mysql slowness when running a compile in parallel



Hi,

The other day I was testing some perl modules when I decided to compile some 
pkgsrc program.   After starting the compilation, my perl tests appeared to 
hang.  Finally, I figured out that if I waited long enough, the tests would 
eventually finish, but that they would take almost 4 minutes rather than the 
usual 1.2 seconds.   Here's an example:

Normal time (no compilations running)
real    0m1.213s
user    0m0.888s
sys     0m0.148s

Abnormal time (compiling wip/modular-xorg-server in the background)
real    3m47.242s
user    0m0.964s
sys     0m0.188s

Here's the first couple of lines from top taken while in the middle of 
an "abnormal" test:

load averages:  2.25,  1.65,  0.83                <snip>
123 threads:   5 idle, 5 runnable, 111 sleeping, 1 zombie, 1 on CPU
CPU states: 32.8% user,  0.0% nice, 66.7% system,  0.5% interrupt,  0.0% idle
Memory: 378M Act, 7320K Wired, 71M Exec, 165M File, 1523M Free

Ktruss indicates that much (most?) of the time difference between normal and 
abnormal is spent waiting for mysql to do a few hundred database table 
inserts (small test records).

Now, I should point out that this is with a custom (current) kernel that has 
LOCK_DEBUG defined.  Since LOCK_DEBUG is listed as expensive, I compiled a 
generic kernel and while the slowdown is less dramatic, it is still 
significant:

Abnormal time with GENERIC kernel
real    0m43.675s
user    0m0.946s
sys     0m0.011s

I do not recall having seen something like this before but then again I cannot 
be sure if and when I last attempted this.  It does seem, however, to point 
to a performance issue somewhere in the system.

This is a Thinkpad T42 (single CPU) running i386 current.

These are the mounted file systems:

/dev/wd0a on / type ffs (soft dependencies, local)
/dev/wd0i on /var type ffs (soft dependencies, local)
/dev/wd0g on /usr type ffs (soft dependencies, local)
/dev/wd0j on /home type ffs (soft dependencies, local)
/dev/wd0e on /c type ntfs (read-only, local)
tmpfs on /tmp type tmpfs (local)
kernfs on /kern type kernfs (local)
procfs on /proc type procfs (local)
ptyfs on /dev/pts type ptyfs (local)

with the mysql database files in /var.

I'm guessing this is a file system issue, perhaps related to locking.  I have 
not seen any recent reports (PRs or otherwise) that look similar to this.  
So, is this a known issue?  Should I file a PR?  What else would be useful 
information?

Thanks,
Sverre


Home | Main Index | Thread Index | Old Index