Bug #14274 Updated: httpd process severely leaks memory for large LDAP queries
ID: 14274
Updated by: venaas
Reported By: Darren.Gamble@sjrb.ca
Old Status: Open
Status: Closed
Bug Type: LDAP related
Operating System: Linux 7.2
PHP Version: 4.0.6
New Comment:
CVS and 4.1.0 should be okay. Please test and reopen if
I'm wrong
Previous Comments:
------------------------------------------------------------------------
[2001-11-28 19:08:13] Darren.Gamble@sjrb.ca
I've installed apache-1.3.20-16 , php-4.0.6-7 and php-ldap-4.0.6-7 , all via the Redhat 7.2
RPMs.
I've also written a simple script to do performance testing against an LDAP server running on
the same machine. The script itself runs fine, but the memory usage of httpd quickly balloons with
each iteration, decreasing the performance. After running the script for only about 10 times or so,
httpd has used a great deal of memory and swap on the machine and stops responding. The init script
needs to run twice to stop the server, which frees the memory.
The only thing that shows up in the httpd error.log is a few lines of:
[warn] child process x still did not exit, sending a SIGTERM
The machine has 512MB each of RAM and swap. The LDAP database ldif is about 7M in size, with about
8k entries.
Please reply if there is any extra information that could be provided. We had looked forward to
developing our DNS application on PHP, and would still like to make this happen if possible.
Here's the revelant portion of the script:
$queries = array("masterserver=ns2so.cg.shawcable.net",
"(|(masterserver=ns2so.cg.shawcable.net)(secondaryserver=ns2so.cg.shawcable.net))",
"objectclass=*");
foreach ( $queries as $key => $query ) {
echo "<LI>Starting query \"".$query."\"...<BR>";
flush();
$start_time = posix_times();
$search_session = ldap_search($ldap_link_id, $LDAP_ROOT_DN[$LDAP_SERVER_ID] , "$query"
);
if ( $search_session ) {
$search_results = ldap_get_entries($ldap_link_id,$search_session);
} else {
page_severe_error("Test failed: ".my_ldap_error());
}
$end_time = posix_times();
$elapsed_time = ($end_time['ticks'] - $start_time['ticks']) / 100.0;
echo "Done. Elapsed time: <B>".$elapsed_time."s</B>.
<B>".$search_results['count']."</B> results
returned.<BR><BR></LI>\n";
}
Here's the configure command, as reported by PHP:
'./configure' 'i386-redhat-linux' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--prefix=/usr'
'--with-config-file-path=/etc' '--disable-debug' '--enable-pic'
'--disable-rpath' '--enable-inline-optimization'
'--with-apxs=/usr/sbin/apxs' '--with-bz2' '--with-curl'
'--with-db3' '--with-dom' '--with-exec-dir=/usr/bin'
'--with-gd' '--with-gdbm' '--with-gettext'
'--with-jpeg-dir=/usr' '--with-mm' '--with-openssl'
'--with-png' '--with-regex=system' '--with-ttf'
'--with-zlib' '--with-layout=GNU' '--enable-debugger'
'--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode'
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-yp' '--enable-wddx'
'--without-mysql' '--without-unixODBC' '--without-oracle'
'--without-oci8' '--with-pspell' '--with-xml'
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14274&edit=1
Thread (2 messages)