The following issue has been SUBMITTED. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=830 
====================================================================== 
Reported By:                ebinger
Assigned To:                
====================================================================== 
Project:                    DBMail
Issue ID:                   830
Category:                   IMAP daemon
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
target:                      
====================================================================== 
Date Submitted:             19-Jan-10 15:09 CET
Last Modified:              19-Jan-10 15:09 CET
====================================================================== 
Summary:                    dbmail-imapd : start to overload the server, kind of
bottleneck.
Description: 
We are experiencing very strange and annoying problem with DBmail.

Our configuration is : DBMAIL 2.2.13, PHP 5.2.11 or PHP 5.3.1, clients :
RoundCubeMail or Outlook, both with IMAP

We used it during some months and it worked perfectly, for testers, more
or less 20 users. But one week ago we switched a large part of our users on
the system, it represent 100 users more (we aim to use it for more or less
250 users)

The system is running correctly until it start to overload, like in this
example :

 11:42:35 up 14 days, 20:49,  1 user,  load average: 11.01, 13.12, 20.83
 11:42:36 up 14 days, 20:49,  1 user,  load average: 11.01, 13.12, 20.83
 11:46:29 up 14 days, 20:53,  1 user,  load average: 25.94, 19.37, 21.56
 11:46:30 up 14 days, 20:53,  1 user,  load average: 25.94, 19.37, 21.56
 11:47:22 up 14 days, 20:53,  1 user,  load average: 22.63, 19.68, 21.55
 11:47:23 up 14 days, 20:53,  1 user,  load average: 22.63, 19.68, 21.55
 11:47:39 up 14 days, 20:54,  1 user,  load average: 22.04, 19.69, 21.52
 11:53:16 up 14 days, 20:59,  1 user,  load average: 46.81, 34.47, 27.06
 11:53:17 up 14 days, 20:59,  1 user,  load average: 46.81, 34.47, 27.06
 11:53:18 up 14 days, 20:59,  1 user,  load average: 45.94, 34.49, 27.10
 11:56:12 up 14 days, 21:02,  1 user,  load average: 48.95, 39.98, 30.40
 11:57:08 up 14 days, 21:03,  1 user,  load average: 53.18, 42.54, 31.81
 11:57:09 up 14 days, 21:03,  1 user,  load average: 53.57, 42.79, 31.95
 11:57:09 up 14 days, 21:03,  1 user,  load average: 53.57, 42.79, 31.95
 12:00:07 up 14 days, 21:06,  1 user,  load average: 59.11, 49.20, 36.22
 12:00:07 up 14 days, 21:06,  1 user,  load average: 59.11, 49.20, 36.22
 12:00:08 up 14 days, 21:06,  1 user,  load average: 59.11, 49.20, 36.22
 12:00:09 up 14 days, 21:06,  1 user,  load average: 59.50, 49.44, 36.37
 12:00:11 up 14 days, 21:06,  1 user,  load average: 59.50, 49.44, 36.37
 12:00:16 up 14 days, 21:06,  1 user,  load average: 59.78, 49.67, 36.51
 12:00:17 up 14 days, 21:06,  1 user,  load average: 59.78, 49.67, 36.51
 12:00:17 up 14 days, 21:06,  1 user,  load average: 59.78, 49.67, 36.51

I've to kill all dbmail-imapd processes and to restart them to put the
server in a correct state. Unfortunatly, after some minutes during the
daytime the problem occurs... so I've to monitor permanently the server...
:-/   b.t.w. users have large delay in mail reading.

Here is my dbmail.conf file :

# (c) 2000-2006 IC&S, The Netherlands 
#
# Configuration file for DBMAIL 

[DBMAIL] 
# 
# Database settings
#

# 
# Supported drivers are mysql, pgsql, sqlite.
#
driver               = mysql

# 
# Supported drivers are sql, ldap.
#
authdriver           = sql

# 
# Host for database, set to localhost if database is on
# the same host as dbmail and you want to use a local
# socket for connecting. 
#
host                 = localhost

# 
# If you want to use TCP/IP for connecting to the database,
# and have the database running on a non-standard port. 
#
sqlport              =                

# 
# When using a local socket connection to the database, fill
# in the path to the socket here (e.g. /var/run/mysql.sock).
#
sqlsocket            = /var/run/mysqld/mysqld.sock

# 
# Database username.
#
user                 = <our user>             

# 
# Database password.
#
pass                 = <our pass>

# 
# Database name.
#
db                   = dbmail               

# 
# Table prefix. Defaults to "dbmail_" if not specified.
#
table_prefix         = dbmail_   

# 
# encoding must match the database/table encoding.
# i.e. latin1, utf8
encoding             = utf8

#
# messages with unknown encoding will be assumed to have 
# default_msg_encoding
# i.e. iso8859-1, utf8
default_msg_encoding = utf8

# 
# Postmaster's email address for use in bounce messages.
#
#postmaster           = DBMAIL-MAILER       

# 
# Sendmail executable for forwards, replies, notifies, vacations.
# You may use pipes (|) in this command, for example:
# dos2unix|/usr/sbin/sendmail  works well with Qmail.
# You may use quotes (") for executables with unusual names.
#
sendmail              = /usr/sbin/sendmail     

#
#
# The following items can be overridden in the service-specific sections.
#
#

# 
# Trace level to send to syslog. Default is 2 (messages, errors, fatals).
#
TRACE_SYSLOG          = 2

# 
# Trace level to send to stderr. Default is 0 (fatals).
#
TRACE_STDERR          = 0

# 
# Root privs are used to open a port, then privs
# are dropped down to the user/group specified here.
#
EFFECTIVE_USER        = nobody   
EFFECTIVE_GROUP       = nogroup 

# 
# The IP addresses the services will bind to.
# Use * for all local interfaces.
# Use 127.0.0.1 for localhost only.
# Separate multiple entries with spaces ( ) or commas (,).
#
BINDIP                = *               

# 
# Default number of child processes to start.
#
NCHILDREN             = 170

# 
# Maximum number of child processes allowed.
#
MAXCHILDREN           =  180

# 
# Unused children to always have availale.
#
MINSPARECHILDREN      = 5

# 
# Maximum unused children allowed to be active.
#
MAXSPARECHILDREN      = 10      

# 
# Child process is restarted after handling this many connections.
#
MAXCONNECTS           = 10000

# 
# Child process will restart after this many connection errors.
#
MAX_ERRORS            = 500

# 
# Idle time allowed before a connection is shut off.
#
TIMEOUT               = 100             

# 
# Idle time allowed before a connection is shut off if you have not logged
in yet.
#
login_timeout         = 60

# 
# If yes, resolves IP addresses to DNS names when logging.
#
RESOLVE_IP            = no

# 
# logfile for stdout messages
#
logfile               = /var/log/dbmail.log        

# 
# logfile for stderr messages
#
errorlog              = /var/log/dbmail.err        

# 
# directory for storing PID files
#
pid_directory         = /var/run

#
# directory for storing the daemon statefiles
#
state_directory       = /var/run

#
# directory for locating libraries (normally has a sane default
compiled-in)
#
#library_directory       = /usr/lib/dbmail

#
# log slow queries at level INFO after n seconds
#
query_time_info       = 30

# 
# log slow queries at level MESSAGE after n seconds
#
query_time_message    = 60

# 
# log slow queries at level WARNING after n seconds
#
query_time_warning    = 60



[SMTP]
# In fact, there isn't anything here by default.
                        

[LMTP]
# 
# Port to bind to.
#
PORT                  = 24                 

[POP]
# 
# Port to bind to.
#
PORT                  = 110                

# 
# If yes, allows SMTP access from the host IP connecting by POP3.
# This requires addition configuration of your MTA
#
POP_BEFORE_SMTP       = no      

[IMAP]

# 
# Port to bind to.
#
PORT                  = 143                

# 
# IMAP prefers a longer timeout than other services.
#
TIMEOUT               = 3000

# 
# If yes, allows SMTP access from the host IP connecting by IMAP.
# This requires addition configuration of your MTA
#
IMAP_BEFORE_SMTP      = yes     

#
# during IDLE, how many seconds between checking the mailbox
# status (default: 30)
#
# idle_timeout          = 30

#
# Provide a CAPABILITY to override the default
#
# capability            = IMAP4 IMAP4rev1 AUTH=LOGIN ACL NAMESPACE CHILDREN SORT
QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE
capability              = IMAP4 IMAP4rev1 AUTH=LOGIN ACL NAMESPACE CHILDREN SORT
QUOTA THREAD=ORDEREDSUBJECT UNSELECT



[SIEVE]
# 
# Port to bind to.
#
PORT                  = 2000               

[LDAP]
PORT                  = 389
VERSION               = 3
HOSTNAME              = ldap
BASE_DN               = ou=People,dc=mydomain,dc=com

# 
# If your LDAP library supports ldap_initialize(), then you can use the
# alternative LDAP server DSN like following.
#
# URI                = ldap://127.0.0.1:389
# URI                = ldapi://%2fvar%2frun%2fopenldap%2fldapi/

# 
# Leave blank for anonymous bind.
# example: cn=admin,dc=mydomain,dc=com     
#
BIND_DN               = 

# 
# Leave blank for anonymous bind.
#
BIND_PW               = 
SCOPE                 = SubTree

# 
# AD users may want to set this to 'no' to disable
# ldap referrals if you are seeing 'Operations errors' 
# in your logs
#
REFERRALS             = yes

USER_OBJECTCLASS      = top,account,dbmailUser
FORW_OBJECTCLASS      = top,account,dbmailForwardingAddress
CN_STRING             = uid
FIELD_PASSWD          = userPassword
FIELD_UID             = uid
FIELD_NID             = uidNumber
MIN_NID               = 10000
MAX_NID               = 15000
FIELD_CID             = gidNumber
MIN_CID               = 10000
MAX_CID               = 15000
FIELD_MAIL            = mail
FIELD_QUOTA           = mailQuota
FIELD_FWDTARGET       = mailForwardingAddress

[DELIVERY]
# 
# Run Sieve scripts as messages are delivered.
#
SIEVE                 = no

# 
# Use 'user+mail...@domain' format to deliver to a mailbox.
#
SUBADDRESS            = yes          

# 
# Turn on/off the Sieve Vacation extension.
#
SIEVE_VACATION        = no      

# 
# Turn on/off the Sieve Notify extension
#
SIEVE_NOTIFY          = no

# 
# Turn on/off additional Sieve debugging.
#
SIEVE_DEBUG           = no          

# 
# Use the auto_notify table to send email notifications.
#
AUTO_NOTIFY           = no          

# 
# Use the auto_reply table to send away messages.
#
AUTO_REPLY            = yes           

# 
# Defaults to "NEW MAIL NOTIFICATION"
#
#AUTO_NOTIFY_SUBJECT        =    

# 
# Defaults to POSTMASTER from the DBMAIL section.
#
#AUTO_NOTIFY_SENDER        =   

# 
# If you set this to 'yes' dbmail will check for duplicate
# messages in the relevant mailbox during delivery using 
# the Message-ID header
#
suppress_duplicates     = no


# end of configuration file


The database is 25Gb large. This is a master to master replication with
another server, very similar, for security purposes. Unfortunaly this last
one have a small internet link so no way to totally switch the users on
it.

Here are the innodb lines in the my.cnf config file :

query_cache_limit       = 64M
query_cache_size        = 1024M
query_cache_type        = 1
query_cache_min_res_unit= 2k
max_connections         = 190
thread_cache_size       = 512
thread_concurrency      = 8
thread_stack            = 128K
join_buffer_size        = 2M
table_cache             = 1024
record_buffer           = 6M
sort_buffer_size        = 4M
read_buffer_size        = 6M
read_rnd_buffer_size    = 4M
max_heap_table          = 128M
max_tmp_tables          = 1024
tmp_table_size          = 128M
myisam_sort_buffer_size = 256M
open_files_limit        = 4096
key_buffer              = 256M
interactive_timeout     = 200
wait_timeout            = 200
connect_timeout         = 60
innodb_buffer_pool_size = 1024M
innodb_log_file_size    = 256M
innodb_log_buffer_size  = 128M
innodb_additional_mem_pool_size=324M
innodb_flush_method     = O_DIRECT
innodb_thread_concurrency=8
innodb_flush_log_at_trx_commit=2
skip-locking


Some workaround i've tested but without noticeable effect :

* using xinetd to start the dbmail-imapd daemon : no change
* tricking here and there the various timeout in dbmail.conf : no change
* various optimisation on the database : no change


To be complete here are some message i found into my 'dmesg' :

possible SYN flooding on port 143. Sending cookies.
dbmail-imapd[5240]: segfault at 38 ip 080586d6 sp bfc4d200 error 4 in
dbmail-imapd[8048000+15000]
dbmail-imapd[4310]: segfault at 4 ip b7d47145 sp bfc4cdb0 error 4 in
libdbmail.so.0.0.0[b7d35000+4c000]

Any idea is welcome :)

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
19-Jan-10 15:09  ebinger        New Issue                                    
======================================================================

_______________________________________________
Dbmail-dev mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

Reply via email to