Depending on your version of Drupal: Drupal 6 core requires PHP's memory_limit to be at least 16MB. Drupal 7 core requires 32MB.
Based off of the error and your post you've allocated 28MB, please confirm in the php.ini file that memory_limit is set correctly. Make sure to restart Apache to apply any changes to php.ini.
Another aspect to consider is the other services that are running on your server, Apache, MySQL, etc. These also take from the total 256MB.
To get an idea on the current memory usage you can type:
free -m
The -m flag outputs the data in MB. The -b switch displays the amount of memory in bytes; the -k switch (set by default) displays it in kilobytes.
You'll get an output like:
total used free shared buffers cached
Mem: 24031 22512 1518 0 1614 8082
-/+ buffers/cache: 12815 11215
Swap: 31999 485 31514
Depending on the available memory you can begin to narrow down the issue to either PHP or if you've outgrown/maxed out the VPS.
EDIT
@Ofri,
There's no exact science to the Apache config.. It boils down to knowing the specs of the machine and mainly trial & error. Monitoring performance of the server during the on-going trial and error periods is important so you can see the postive/negative impact.
I would stop Apache, edit the httpd.conf according with the values below and see how the server behaves:
- MaxKeepAliveRequests 100
- KeepAliveTimeout 15
- MinSpareServers 5
- MaxSpareServers 10
- StartServers 5
- MaxClients 150
- MaxRequestsPerChild 300
Keep in mind Drupal is a system hog and you may ultimately end up upgrading the VPS to 512MB.
-Brendan
Best Answer
Apache running as www-data is the default in Debian Lenny. You might be confusing a single 'parent' apache process (running as root) with apache 'children' doing HTTP request processing (running as www-data). Both 'parent' and 'children' processes should look like they were started with
/usr/sbin/apache2 -k start
(when youps aux | grep apache
), and the only difference is the process owner.To control init startup scripts you could use
sudo sysv-rc-conf
(sudo aptitude install sysv-rc-conf
if you don't have it - it is just an easy curses-like Perl wrapper for init scripts).