Question
I'm doing a new install of Twiki-4.0.1 on Apache2.
I'm following the instructions on
TWikiInstallationGuide
I have completed stages 1-6, and I think that is OK.
I go to
https://mydomain/twiki/bin/configure, and I can start filling in the values on that page. I first had a warning about LocalSite.cfg not being found, so I copied
lib/LocalSite.cfg.txt to
lib/LocalSite.cfg and the warnings went away. The values also changed to reflect the different defaults that are in that file.
When I have changed all of the values I click next and then Apache returns a 500 page. Worse than this apache then grabs all available memory on my server, leaving me unable to create any processes to diagnose the problem or save my server, a reboot is required.
lib/LocalSite.cfg is
-rw-r----- apache apache
The apache error logs show
[Mon Mar 27 17:48:20 2006] [error] [client yyyy] [Mon Mar 27 17:48:20 200
6] configure: Can't exec "/usr/bin/rcs": No such file or directory at /var/www/t
wiki/bin/configure line 346., referer: https://xxxx/twiki/
[Mon Mar 27 17:48:51 2006] [error] [client yyyy] (12)Cannot allocate memo
ry: couldn't create child process: 12: configure, referer: https://xxxx/twiki/bin/configure
[Mon Mar 27 17:48:51 2006] [error] [client yyyy] (12)Cannot allocate memo
ry: couldn't spawn child process: /var/www/twiki/bin/configure, referer: https:/
/xxxx/twiki/bin/configure
Thanks for your time
Environment
--
JamesWestby - 27 Mar 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Don't copy
lib/LocalSite.cfg.txt to
lib/LocalSite.cfg . The warning is harmless,
LocalSite.cfg is created by
/bin/configure.
Otherwise it looks as if you don't have
RCS installed, or as if it isn't in its "usual" location. What do you get when you say
which rcs to your shell?
--
HaraldJoerg - 27 Mar 2006
Thanks for responding.
I hand crafted a
lib/LocalSite.cfg with values for my server (e.g. rcs in /usr/local/bin) to bypass this problem. It now looks like it is not a bug in configure, as I can only get a couple of saves before a similar thing happens. I have altered apache to use fewer processes and that helps a bit, but it looks like I'm going to have to upgrade my hosting if I want to run TWiki.
So, it looks as if the out of memory problem was coming first, and so it's not the fault of TWiki. Delete this question if you like, as it is not really a problem to begin with.
Are there any ways of using less memory for TWiki? e.g. is mod_perl less memory intensive?
--
JamesWestby - 27 Mar 2006
When the script is run after clicking the "next" button, the memory of the apache process serving the request shoots up to around 150MB, where it hits the limits of my server. I've upgraded my server so that it no longer brings it to its knees, and I can restart apache to return to normal.
The apache process does not seem to lose the memory on its own, (though I have only waited a few more minutes), is this a feature of hitting out of memory problems and getting 500 errors? I would have thought that apache would free whatever it is that is using this memory when it hit the error.
What would it be about this script that would be causing the large memory use. I'm not very skilled in perl, so is it likely to be the compiled script, the data it is processing, or something else?
I have run it under mod_perl (yes, I saw the warnings), and the memory only goes up to about 130MB, and the page actually loads.
Obviously this isn't a major concern, as I've done the configuration now, and I can always do it by hand if I need to change anything, but I would like to understand what is happening, as like I said there is a similar problem with saving, and that will probably become critical if, say, a user uploads an attachment.
--
JamesWestby - 28 Mar 2006
mod_perl is
more memory intensive, not less. it keeps multiple images around.
The only thing I can think of is a known bug in 4.0.1, where the
NameFilter gets corrupted. But that shouldn't eat memory. On my systems (Debian,
WinXP, Apache 1.3, Apache 2) I can't reproduce this, so I'm curious as to what is causing it. it's almost impossible to debug outside an environment where the problem is reproducible.
--
CrawfordCurrie - 28 Mar 2006
I'm happy to have a little poke around if you would like.
That's what I had readabout mod_perl, but it seems to restrain configure somewhat.
The NameFilter bug is not present in my version, the value is properly html escaped in my browser.
I tried stripping out the style sheet embedded in the file to reduce the size of the page it is building and that didn't solve the problem. (Would it be better anyway to have this as an external style sheet?)
Does the configure load a lot of modules? I can see that on the first visit it loads several modules. I can't get memory usage reporting to work correctly Apache::Status, so I don't know whether that is the cause. However it doesn't seem to load any more when going to the next stage, so that probably isn't it.
--
JamesWestby - 29 Mar 2006
Not sure, but
TWikiOnApache2dot0Hangs might apply, depending on the Apache 2.0 version you are using.
--
PeterThoeny - 29 Mar 2006
I'm using 2.0.51, so it should be OK. I can't reproduce that bug anyway.
The problem is that now i can't reproduce the problem I originally had, and I'm not sure what I did to prevent it. I have hardy touched my server over the last few days. The only thing I can think of was installing a couple of perl modules for SpamAssassin. If it ever crops up again I will investigate further.
Thanks for your help.
James
--
JamesWestby - 31 Mar 2006
In case anyone comes accross this with similar symptoms it looks as though it was modsecurity buffering the large POST that was eating up the memory. Turning off the checking for the appropriate bits seems to have removed the problem.
I'm still not sure why the memory usage was that high though, maybe it's just innacurate reporting of the memory usage.
--
JamesWestby - 20 Apr 2006