Moodle is using HUGE amounts of memory when users first login the system. Over 1GB of RAM. Here is an example:
(Partial dump from "ps -F -C php")
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
mbalearn 12313 21069 24 130748 91300 1 08:35 ? 00:04:06 /usr/bin/php
mbalearn 12314 21069 13 131500 94468 2 08:35 ? 00:02:21 /usr/bin/php
mbalearn 13669 21069 17 131821 99020 2 08:39 ? 00:02:20 /usr/bin/php
mbalearn 13670 21069 7 130578 80168 0 08:39 ? 00:00:58 /usr/bin/php
mbalearn 13671 21069 5 130649 99104 0 08:39 ? 00:00:42 /usr/bin/php
mbalearn 13672 21069 3 132230 102596 15 08:39 ? 00:00:24 /usr/bin/php
mbalearn 13673 21069 5 130815 117128 3 08:39 ? 00:00:45 /usr/bin/php
mbalearn 13674 21069 12 469172 1448992 6 08:39 ? 00:01:36 /usr/bin/php
The last entry shows php using 1.4Gb of memory.
How this got started: Some of our users would log into moodle then end up at a white screen. I turned on all the debugging info on and found out that php was running out of memory. I'd had this problem last year running 2.7 and had increased the memory that php could use to 384Mb. It worked fine for the whole school year that way.
New school year we upgraded to 2.9 and as soon as students and teachers started using it, it started running out of memory. I kept increasing the amount of memory php could use in small increments and that would fix things for a day or two or three. So I'd increase it a bit more and it would work for a few days. The last iteration of that was when it ran out of memory and I had php memory set to 1.5Gb. So I bumped it to 2Gb and it's been fine for a week.
About our system:
We use external database authentication and enrollment. Though it's not actually going to an external database, it's authenticating and controlling enrollment from tables we've added to the moodle database.
The biggest thing the we do that most people don't is that we give all our students and teachers access to all our courses. Currently that's 263 courses.
Seems like the spike in memory usage is only when users first login, after that, memory usage goes back down to a very reasonable, and manageable, 100Mb ish.
Anyone else having this kind of problem or have a clue what's going on?