Seg fault with Image::Magick on FreeBSD

2005-11-09 Thread Len Kranendonk



As soon as I preload Image::Magick under mod_perl2 
on FreeBSD (5.3, 5.4 and 6.0) I 
get a "Segmentation fault (core dumped)" when 
I start Apache.
 
Without preloading it works fine. 
 
What's the best place to report this bug ? 

 
 
 
 


Re: Seg fault with Image::Magick on FreeBSD

2005-11-09 Thread Len Kranendonk
> I'm going to have to eat part/all of my words here as there is no port for
> p5-Image-Magick.

There is a port ImageMagick which also contains the perl module
Image::Magick.
I've mailed the maintainer. Not sure though if he would be able to fix it as
he might
not be into perl.




Re: Seg fault with Image::Magick on FreeBSD

2005-11-09 Thread Len Kranendonk
> Somewhere, it uses $& or one of those operators that change the regex
engine of
> perl.  I don't know if its been fixed in 5.8.7 or maint.

I'm running 5.8.7 and it still has this problem.

I'm currently working around it by not preloading Image::Magick and using
"require"
to load Image::Magick on places where it's needed. It works but it's
ugly

Len




Re: ImageMagick

2005-11-09 Thread Len Kranendonk
> trunks# apachectl start
> Segmentation fault (core dumped)
> 
> Of course, the FreeBSD pkg builds are without debugging.
> I'll give that a whirl shortly.


Thanks for that Philip. I know perl but this is way beyond my reach.



Out of memory ?!

2005-12-03 Thread Len Kranendonk
Hello all,

Once in a while I get "Out of memory" errors on our mod_perl servers. They
look like this:

Out of memory during request for 77000 bytes, total sbrk() is 14952448
bytes!
[Mon Nov  7 00:08:01 2005] thaw.al): Callback called exit at
../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/tha
w.al) line 363.

At last Apache crashes completely.

It's not related to a specific application: It happens on our WebGUI (= cms)
nodes but also
on our (relatively simple) custom applications that run on different boxes.

All perl stuff is running under ModPerl::Registry.

We're using FreeBSD 5.3 / apache-2.0.50_3 / mod_perl2-1.99r16 / perl-5.8.5
all installed using the ports mechanism.

I'm using MaxRequestPerChild 600 to limit the http size growth.
I've tried to restart apache every night but I still get that "Out of
Memory" errors.

Anyone familiar with this problem ?

Len




Re: Out of memory ?!

2005-12-03 Thread Len Kranendonk
> Are they always in Storable::thaw?  What are you thawing?

No, it happens on any module:

Out of memory during request for 55504 bytes, total sbrk() is 26630144
bytes!
[Fri Dec  2 11:24:11 2005] TagFilter.pm: Callback called exit at
/knvb/WebGUI/li
b/HTML/TagFilter.pm line 402.
[Fri Dec  2 11:24:11 2005] Carp.pm: Callback called exit at
/usr/local/lib/perl5
/5.8.5/CGI/Carp.pm line 314.

> What code is running on both of these?

A wide range of perl modules, like HTML::Template, XML::Simple, etc, etc.

I'm going to upgrade to latest mod_perl2 and start using Apache2::SizeLimit
and
Apache2::Resource. Hope that will fix it.




Why is my apache parent process growing...

2006-01-02 Thread Len Kranendonk




Happy 2006 everyone,
 
I'm running Apache/2.0.54, mod_perl/2.0.1, 
Perl/v5.8.7 on FreeBSD 6.0. 
 
Right after starting apache (with preloading the 
needed perl modules) the httpd root process is about 40MB. 
After several days it has grown to over 
100MB.
 

I'm using Apache2::SizeLimit to kill of httpd 
childs that get too large. I'm using this configuration:

 
$Apache2::SizeLimit::MAX_PROCESS_SIZE = 
10;
$Apache2::SizeLimit::MAX_UNSHARED_SIZE = 
25000;
 
The problem here is that when the Apache parent 
process gets 10 KB big, the spawned childs 
also are that size, which means that a spawned 
child is killed immediately after it served its first request. 
The only way to decrease the parent size is to stop 
and start apache.
 
My understanding is that the parent process is not 
supposed to serve any requests itself. 
It's entire job is to manage the children. So, how 
come it is growing, and more importantly, how can
I control it ?
 
BTW: I have this problem on all our FreeBSD boxes 
running different applications. 
Is FreeBSD / mod_perl just a bad combo 
?
 
Len 
Kranendonk


Re: Why is my apache parent process growing...

2006-01-02 Thread Len Kranendonk

 Do you have any globals or other shared information that grows very
 large?  Do you read in any large data sets either from a database or
 a file into the application all at once?


We're using a global %session hash, which is undef 'fed when the session is 
closed.
I'm not reading in large data sets, but even if I did that should grow the 
child process,

not the parent process, right ?

The application I'm talking about is WebGUI, a CMS written in perl. I've 
mailed the
WebGUI list earlier today. It seems that the people running on Linux don't 
have the
problem that's causing me pain. That's why I start to believe that it's a 
FreeBSD/mod_perl issue.


The problem is not limited to WebGUI, I also have it on two boxes that serve 
football
results. The only thing that's running there is SOAP::Lite, HTML::Template, 
XML::Simple
and Cache::FileCache. After two months that http root process has grown from 
20MB to 185MB.


Len



Re: Why is my apache parent process growing...

2006-01-02 Thread Len Kranendonk

How are you measuring this?


top, or ps aux and watch the RSS column (the real memory (resident set) 
size of the process (in 1024 byte units)).


A sample top output:

 PID USERNAME PRI NICE   SIZERES STATETIME   WCPUCPU COMMAND
87075 www40   178M   174M accept   0:32  3.08%  3.08% httpd
86839 www40   175M   171M accept   1:53  0.39%  0.39% httpd
86827 www40   188M   184M accept   2:12  0.00%  0.00% httpd
86836 www40   187M   183M accept   2:06  0.00%  0.00% httpd
86830 www40   172M   168M accept   2:02  0.00%  0.00% httpd
86831 www40   177M   173M accept   2:02  0.00%  0.00% httpd
86858 www40   189M   185M accept   1:58  0.00%  0.00% httpd
87070 www40   170M   167M accept   0:49  0.00%  0.00% httpd
87073 www40   187M   184M accept   0:38  0.00%  0.00% httpd
87074 www40   174M   170M accept   0:29  0.00%  0.00% httpd
69201 root  960   157M   154M select   0:13  0.00%  0.00% httpd

The initial size of the httpd root process was 46 MB. 


That's correct.  Are you using Cache::FastMmap, or anything else that
does memory-mapping of files?  That might yield an apparent larger size
if the parent process is one of the ones that has the mmap'ed file open.


No, I'm not using Cache::FastMmap. 


Re: Why is my apache parent process growing...

2006-01-02 Thread Len Kranendonk

Are you using IPC::SharedCache for your HTML::Template caching?


No, I'm using the "file_cache=>1" option, which uses Storable (I believe).


Re: Why is my apache parent process growing...

2006-01-02 Thread Len Kranendonk
This doesn't really help you, but I don't notice the parent growing on 
any of my FreeBSD boxes doing a variety of things.


So, most likely I'm doing something that you don't do
Are you using ModPerl::Registry, because I still do.


Found it !!! Why is my apache parent process growing...

2006-01-03 Thread Len Kranendonk

I found it !!!

Issueing an "apachectl restart" (or kill -HUP) make the apache parent 
process size grow !

This is the case on all of our FreeBSD boxes. I can't reproduce it on Linux.

Take a look at this:


apachectl start
# ps aux|grep httpd | grep root
root  70820 59.0  5.6 46408 43552  ??  Ss4:03PM   0:04.40 
/usr/local/sbin/httpd -k start


So: 43MB right after starting

Now send it a SIGHUP:

# kill -HUP 70820
# ps aux| grep httpd | grep root
root  70820 17.4  7.7 62440 59564  ??  Rs4:03PM   0:08.48 
/usr/local/sbin/httpd -k start


Wow: the HTTP root process has grown from 43 to 59MB just because I sent it 
a SIGHUP.


On my test box it will take about 50 "apachectl restart" commands, but then 
apache crashes with

a "Out of memory during request" error.

Philip, as you're using FreeBSD too, could you confirm this ?

I'm using a log rotation script which send a SIGHUP to apache every night, 
so that was actually

causing the apache root process to grow.

Thanks anyone for helping me to find this problem !

Len 



Why is my apache parent process growing...

2006-01-03 Thread Len Kranendonk



Hello all,
 
I'm running Apache/2.0.54, mod_perl/2.0.1, 
Perl/v5.8.7 on FreeBSD 6.0. 
 
Right after starting apache (with preloading the 
needed perl modules) the httpd root process is about 40MB. 
After several days it has grown to over 
100MB.
 

I'm using Apache2::SizeLimit to kill of httpd 
childs that get too large. I'm using this configuration:

 
$Apache2::SizeLimit::MAX_PROCESS_SIZE = 
10;
$Apache2::SizeLimit::MAX_UNSHARED_SIZE = 
25000;
 
The problem here is that when the Apache parent 
process gets 10 KB big, the spawned childs 
also are that size, which means that a spawned 
child is killed immediately after it served its first request. 
The only way to decrease the parent size is to stop 
and start apache.
 
My understanding is that the parent process is not 
supposed to serve any requests itself. 
It's entire job is to manage the children. So, how 
come it is growing, and more importantly, how can
I control it ?
 
BTW: I have this problem on all our FreeBSD boxes 
running different applications. 
Is FreeBSD / mod_perl just a bad combo 
?
 
Len Kranendonk


What handler am I ?

2006-02-01 Thread Len Kranendonk



Hello all,
 
Suppose I have this:
 
PerlModule My::Module
PerlChildInitHandler My::Module
PerlOutputFilterHandler My::Module
 
In the sub handler {} , is there a way to 
determinate what type of handler I am supposed to be ? 
 
I'm running mod_perl2 for that 
matters.
 
Len


Re: What handler am I ?

2006-02-01 Thread Len Kranendonk

Exactly what I was look for ! Thanks !

- Original Message - 
From: "Geoffrey Young" <[EMAIL PROTECTED]>

To: "Len Kranendonk" <[EMAIL PROTECTED]>
Cc: 
Sent: Wednesday, February 01, 2006 3:32 PM
Subject: Re: What handler am I ?





Len Kranendonk wrote:

Hello all,

Suppose I have this:

PerlModule My::Module
PerlChildInitHandler My::Module
PerlOutputFilterHandler My::Module

In the sub handler {} , is there a way to determinate what type of 
handler I am supposed to be ?


yes, current_callback()



I'm running mod_perl2 for that matters.


yes, it does :)

for mp2 it's

 use ModPerl::Util;
 my $callback = ModPerl::Util::current_callback();

for mp1 it's simply

 my $callback = $r->current_callback();

HTH

--Geoff





Re: What handler am I ?

2006-02-03 Thread Len Kranendonk

 my $callback = ModPerl::Util::current_callback();


For a PerlOutputFilterHandler  the current_callback() function returns 
"PerlResponseHandler".


That sounds like a bug, or am I doing something wrong ?

Server: Apache/2.0.54 (FreeBSD 6.0) mod_ssl/2.0.54 OpenSSL/0.9.7g 
mod_apreq2-20050712/2.1.3-dev mod_perl/2.0.1 Perl/v5.8.7 



Re: clusters

2006-05-09 Thread Len Kranendonk

And also this:
"NDB is an in-memory storage engine"


No longer true: As of MySQL 5.1.6 it's possible to store
tables on disk rather than in memory.

See http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-disk-data.html

But, I wouldn't recommend using MySQL cluster to power your
high traffic website. I've tested it but the throughput is at least 10 - 
100x

worse in compare to a good old MySQL master / slave setup on the
same hardware. Esspecially the writes are slow.

SQL Relay offers load balancing functionality, without having to change
your existing code: http://sqlrelay.sourceforge.net/

Len