I have been using drupal for a while. For some reason when it is running on our basic webserver it is sucking up all the available memory. I am currently using drupal 4.7.3. I have switched cacheing on but that isn't always helpful as it only caches authenticated users and the site is going to be used for mostly anonymous users. I have a couple of drupal sites running on a VPS with php4 and mysql 4 and they don't seem to show this hoovering activity. On the site I am having problems with it is using php5 (fedora core 4) and mysql 4 running on a dual core intel Xeon with 512mb RAM. The site is blocked from outside at the moment so I can't give you the URL.
Are there any specific settings within drupal or the php code / php ini settings I could be changing so that it lets go of memory it has grabbed? It seems just to keep on using memory until there is none left rather than letting go of each chunk after each page has been viewed/ time has passed. I have changed the memory limit settings several times between 12M (too small to show modules page) and now it is on 16M. Each page view is taking all the allocated chunk and sucking the life out of the machine!
Any ideas?
Comments
Modules
What modules are you running? Is one of them categories? If so - do you have a lot of categories and/or categories items?
I do have categories
I do have categories installed. I have 4 containers and about 5 categories which doesn't seem excessive. Is there a critical mass of categories where it all goes wrong?
I have most of below enabled.
aggregator Aggregates syndicated content (RSS, RDF, and Atom feeds).
archive Displays a calendar for navigating older content.
bio User Biography.
block Controls the boxes that are displayed around the main content. required required
blog Enables keeping an easily and regularly updated web page or a blog.
blogapi Allows users to post content using applications that support XML-RPC blog APIs.
category Allows you to structure your site and categorize content.
category_bulkedit Provides an interface for editing multiple categories or containers at once. Requires the category module.
category_display Allows additional output to be displayed and toggled for category and container nodes. Requires the category module.
category_export Allows category trees to be exported as printer-friendly HTML. Requires the category module.
category_legacy Allows you to convert your taxonomy and book data into category data, and vice versa. Requires the category module.
category_menu Creates and manages a set of menu items that correspond to your site's category hierarchy. Requires the category module.
category_outliner Provides an administrative interface for easily editing and re-arranging categories. Requires the category module.
category_transform Allows nodes of any type to be transformed into categories or containers. Requires the category module.
category_views Renders node listings on category pages using a view. Requires the category module and the views module.
comment Allows users to comment on and discuss published content.
contact Enables the use of both personal and site-wide contact forms.
content Allows administrators to define new content types.
filter Handles the filtering of content in preparation for display. required required
help Manages the display of online help.
img_assist Enables users easily upload and insert images into content.
indexpage Displays index pages for each node type, with alphabetical and taxonomy filters.
legacy Provides legacy handlers for upgrades from older Drupal installations.
locale Enables the translation of the user interface to languages other than English.
menu Allows administrators to customize the site navigation menu.
module_builder Builds scaffolding for custom modules.
nice_menus Make drop down css/javascript menus for site navigation and admin menus
node Allows content to be submitted to the site and displayed on pages. required required
nodereference Defines a field type for referencing one node from another. Note: Requires content.module.
number Defines numeric field types. Note: Requires content.module.
optionwidgets Defines selection, check box and radio button widgets for text and numeric fields. Note: Requires content.module, text.module and number.module.
page Enables the creation of pages that can be added to the navigation system.
path Allows users to rename URLs.
ping Alerts other sites when your site has been updated.
poll Allows your site to capture votes on different topics in the form of multiple choice questions.
profile Supports configurable user profiles.
search Enables site-wide keyword searching.
statistics Logs access statistics for your site.
story Allows users to submit stories, articles or similar content.
system Handles general site configuration for administrators. required required
tables Filter to allow insertion of a table
tasks A module to make task nodes.
taxonomy Enables the categorization of content.
text Defines simple text field types. Note: Requires content.module.
throttle Handles the auto-throttling mechanism, to control site congestion. required
tracker Enables tracking of recent posts for users.
upload Allows users to upload and attach files to content.
user Manages the user registration and login system. required required
userreference Defines a field type for referencing a user from a node. Note: Requires content.module.
views The views module creates customized views of node lists.
views_theme_wizard The views theme wizard helps create stub theming for views.
views_ui The views module creates customized views of node lists.
watchdog Logs and records system events. required required
webform Enables the creation of forms and questionnaires.
workspace For individual users to manage their workspace
caching- backwards
You have it backwards as far as caching- more caching is done for anonymous users, and very little for authenticated users (who may have unique content).
---
Work: BioRAFT
Ah, that's better then :-)
Ah, that's better then :-) Caching seems to reduce the problem slightly but the memory just keeps on disappearing until httpd is restarted and then it comes back.
Thats a LOT of enabled
Thats a LOT of enabled modules.
Just out of interest - try disabling the categories. I've noticed on my setup that Categories is HUGELY innefficient in certain situations.
How many nodes do you have categorised (eg, if 1 node is in 3 cats, count it as 3 and not 1...). I ask because one of the things that Category likes to do is load every combination of categories and nodes into a PHP array. On my setup, I have 24,000 articles + 350 cats and it alsmost (well, DOES) kill drupal. I had to up the memory limits to about 120MB.
I think I probably have 120
I think I probably have 120 nodes. Not all of them are in categories. If they are in a category it is only a single one. My other site has more nodes and more categories, again each article is in a single category, but it doesn't seem to slurp memory away for some reason. It may be because I started this one with the legacy taxonomy module in place and the other one I didn't.
Without categories enabled drupal behaves exactly the same way for me. Clicking any link uses up lots of memory just as before. I have cut down which category modules I have enabled but it doesn't seem to help and the memory is just used up.
There must be a more efficient way of loading in articles and categories so that you don't use massive amounts of memory. Instead of an array, some sort of tree stucture would be more efficient as you'd only load the branch someone was actively looking at and you'd only load the current limb rather than all the way down to the leaves.
Debugging
Well you've already said that disabling it didn't fix it - so logically we can assume Category is innocent.
Its a real pain to install, but there is an extension for PHP (XDebug) which allows you to list all kinds of usefull and useless crap. It might help you diagnose the problem.
Alternatively, try disabling modules to find the offender.
Xdebug sounds a good idea.
Xdebug sounds a good idea. That will keep me out of mischief for the day :-)