I ask this question only after trying many different
attempts to resolve.  On my EmbperlObj driven site,
apache stalls sometimes, resulting in the spawning of
numerous other instances (probably due to the fact
that each client winds up with a stalled httpd server
on this busy site... the two just wait and wait as new
clients spawn their own infinite wait sessions).

The setup:
This began with a simple, standard FreeBSD ports
install, which I think was Apache/1.3.20, mod_perl
1.2.6 and perl 5.005_03.  I read some stuff about a
memory leak in pre 5.005_04 perl, and I was seeing
memory leak-like problems so I went ahead and upped
everything.  It now runs Apache/1.3.22, mod_perl 1.2.6
and perl v5.6.1.  Additionally, I (re)installed all
the latest stuff that was required from CPAN.  The
Embperl version is 1.3.4.  This runs a database heavy
site using mysql 3.23.42.  The server itself is a Soyo
Dragon K7V Athalon 1ghz, 512M DDR memory with 3 7200
RPM ATA drives (one accidently throttled to UDMA 33
due to "non-ATA66 compliant cable" (to be fixed soon).

The original install used a DSO apache, the new one
has everything compiled in.

The upgrades did not really help anything.  The memory
climbs all day long from about 8M to 40M for each
instance of apache.  And the lockups still occur. 
Basically, you get about halfway through a page load,
and then you wait for a long time.  If you wait long
enough, it might go away, in fact it often does.

Initially, I thought it was just an efficiency
problem.  I tweaked the heck out of mySQL tables and I
believe they are quite tuned.  I upped some of the
memory allocations to mysql in addition to the table
tuning.  I studied my Embperl code a great deal and
made sure, for example, that every database connection
was definitely very neatly opened, used and closed.  I
put some subroutines into a module and load it as an
object so that the code is more lightweight
(consolidating common tasks), e.g. in the init.htm
file: use commonTools; $req->{'ct'} = new commonTools.
 In the close.htm file: undef $req->{'ct'}.  

Still thought it could be the database.  I took a
great deal of the local SQL load off and moved it to a
very nice, dual proc, high memory separate server.  I
got into caching just about everything (as I planned
to do, but it had urgency now) so that data is most
often fetched from a file rather than from the
database.  I put these cache files in sub-folders by
date and by numeric ids, whichever was appropriate for
the task.  So none of these caches are ever found in a
folder with more than about 200 files, often just a
few files or even one.  I took these cache files and
divvied them across 3 drives after watching iostat all
day long.  This and other stuff increased
responsiveness, but still the lockups remain.

I watch the processlist in mysql when this happens, I
see nothing wrong, no waiting or locking issues.  It
may be important to note that I lock while updating a
table.  There is no reason these locks wouldn't be
brief, AND the demand for a lock does cause delays on
these update submits as they wait for all reads to
terminate, but these are expected delays.  There are
no untidy locks, I'm sure they are all done correctly.

I use "MySQL Semaphore" for EMBPERL_SESSION_CLASSES. 
I'm actually suspicious of using Semaphore locking a
bit, but I guess I don't exactly get IPC right now and
so I don't know where to look for trouble.  A moment
ago, I moved this to mysql locking.  We'll see if this
does it.

I have also had it so that Apache loads most of the
modules ahead of time.  I have used Apache::DBI and
have done without (btw, it seems to me that
Apache::DBI and Apache::SessionX are a deadly combo
not to be used together at this point, but that's a
different topic).  I switched to
Apache-SessionX-2.00b3 (very handy changes).

I have used Apache::Status to try to find anything
obvious (not sure if I get how this can help so maybe
someone can give advice).

BTW, none of this generates errors.  Aside from the
runaway processes it can and does cause, it is a user
perception issue.  But it's definitely a real issue
and one that will keep my site from scaling much
further.

So it's two problems: stalls and memory leak-like
behavior.  They don't exactly seem related but could
be.

Please, someone, give me any advice you can think of
that may help.  I am losing hair.
-Jarrod
P.S. Thanks Gerald and Ed for your previous help.

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to