Reducing memory usage for custom resources for services module

Events happening in the community are now at Drupal community events on www.drupal.org.
cheewe's picture

I have a Drupal 6.19 site that also links to some mobile app via custom resources written using Drupal Services 3.x module.

I have set php memory limit to 512M. The site works fine without any memory issues.

However, because the mobile app fires 4-5 concurrent web services requests as a burst, a single app running can apprently cause my server to run out of memory and return a 500 Internal Server Error. The log shows this error:
Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/cmadmin/public_html/drupal/index.php

index.php is drupal's of course.

The hosting claims it's a problem with my script and I should fix it.

Has anyone faced this before?

It seems like each webservice forks a new drupal instance that takes up lots of memory >>200MB, which is why 4-5 will cause it to hit the 1GB limit imposed by my cloud linux hosting. This is very alarming because it is problematic with 1 app only?!

I don't understand why each web service is causing a new instance to be loaded and each instance requires so much memory.

Can someone provide me guidelines how to reduce the memory consumption of the custom resources module that I have written? The custom resources make some simple SQL queries that return small amounts of data (max 500 rows of 5-6 integers)

Or is it some drupal service setting?

Any guidance / tips appreciated!

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week