ispconfig writeconf.php process "runaway"

Discussion in 'General' started by lrider, Jun 19, 2008.

  1. lrider

    lrider New Member

    Hello,

    This morning at 10:00 I updated tha information of a user in ispconfig to see how it updated the /etc/passwd file.

    It's now 18:30 and the process still running

    This is a ps -ef report of the affected processess:
    ******************************************
    root 3850 3734 41 13:04 ? 02:17:45 /root/ispconfig/php/php -q /root/ispconfig/scripts/writeconf.php
    mysql 3196 3163 3 01:02 ? 00:38:15 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysq
    ld.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
    ******************************************
    This machine is a HP DL380G4 with DUAL Xeon, 3 Gb of RAM and a SAN (MSA1000) by fiber for disk.

    I have checked, and optimied the database.

    The process seems to be in a "loop".

    What can I do?

    Thank's in advance.....Larry
     
  2. falko

    falko Super Moderator

    What's the output of
    Code:
    ls -la /root/ispconfig
    ?
    Any warnings in /home/admispconfig/ispconfig/ispconfig.log?
     
  3. lrider

    lrider New Member

    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.
     

Share This Page