View Single Post
  #3  
Old 23rd June 2008, 16:03
lrider lrider is offline
Member
 
Join Date: Nov 2006
Posts: 70
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Hello again,

Finally I find out what was going on.

First of all I want to point out that the server has to process the following data each time I change a user:

1 Client.
3 Sites
1 of the sites with 3000 users and 28 co-domains.

What happens is that the script ispconfig_sendmail.lib.php took way too long to process the co-domains, consuming lots of "mysql" resorces.

I find out by inserting entry-logs in the code.

Finally a solved the problems using 2 aproaches:

1) I changed the select from the co-domains to be done only once per site.
*********************************************
if (empty($codomains)){
$codomains = $mod->db->queryAllRecords("SELECT * from isp_dep,isp_isp_domain where isp_dep.child_doc_id = isp_isp_domain.doc_id and isp_dep.child_doctype_id ='".$isp_web->domain_doctype_id."' and isp_dep.parent_doctype_id = '".$isp_web->web_doctype_id."' and isp_dep.parent_doc_id = '".$web_doc_id."' and isp_isp_domain.status != 'd'");
}
if(!empty($codomains)){
foreach($codomains as $codomain){

*********************************************

2) I changed the search to be done only on those domains with the dns-mx checked.

*********************************************

if (empty($codomains)){
$codomains = $mod->db->queryAllRecords("SELECT * from isp_dep,isp_isp_domain where isp_dep.child_doc_id = isp_isp_domain.doc_id and isp_dep.child_doctype_id ='".$isp_web->domain_doctype_id."' and isp_dep.parent_doctype_id = '".$isp_web->web_doctype_id."' and isp_dep.parent_doc_id = '".$web_doc_id."' and isp_isp_domain.status != 'd' and isp_isp_domain.domain_dnsmail = '1'");
}
if(!empty($codomains)){
foreach($codomains as $codomain){

*********************************************

With these changes, I reduced the process time dounw to 1 hour, and everything finished ok.

I would like to know your point of view, mainly to see if this was the best aproach, or if you think of a better solution to change this one.

Normally a domain can have lot's of co-domains, so all of them point to the same web. That fact not always works for mail addresses, so the size and the time expent to create the "/etc/mail/virtusertable" can be reduced a lot.

Thank's in advance.....Larry.
Reply With Quote